# Organizations ## List organizations the user has access to **get** `/organizations` Retrieve a list of organizations a particular user has access to. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Query Parameters - `id: optional array of string` Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements by repeating the query value. - `containing: optional object { account, organization, user }` - `account: optional string` Filter the list of organizations to the ones that contain this particular account. - `organization: optional string` Filter the list of organizations to the ones that contain this particular organization. - `user: optional string` Filter the list of organizations to the ones that contain this particular user. IMPORTANT: Just because an organization "contains" a user is not a representation of any authorization or privilege to manage any resources therein. An organization "containing" a user simply means the user is managed by that organization. - `name: optional object { contains, endsWith, startsWith }` - `contains: optional string` (case-insensitive) Filter the list of organizations to where the name contains a particular string. - `endsWith: optional string` (case-insensitive) Filter the list of organizations to where the name ends with a particular string. - `startsWith: optional string` (case-insensitive) Filter the list of organizations to where the name starts with a particular string. - `page_size: optional number` The amount of items to return. Defaults to 10. - `page_token: optional string` An opaque token returned from the last list response that when provided will retrieve the next page. Parameters used to filter the retrieved list must remain in subsequent requests with a page token. - `parent: optional object { id }` - `id: optional string or "null"` Filter the list of organizations to the ones that are a sub-organization of the specified organization. "null" is a valid value to provide for this parameter. It means "where an organization has no parent (i.e. it is a 'root' organization)." - `OrganizationsAPIOrganizationID = string` - `"null"` Filter the list of organizations to the ones that are a sub-organization of the specified organization. "null" is a valid value to provide for this parameter. It means "where an organization has no parent (i.e. it is a 'root' organization)." - `"null"` ### Returns - `errors: array of unknown` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: array of Organization` - `id: string` - `create_time: string` - `meta: object { flags, managed_by }` - `flags: optional object { account_creation, account_deletion, account_migration, 2 more }` Enable features for Organizations. - `account_creation: string` - `account_deletion: string` - `account_migration: string` - `account_mobility: string` - `sub_org_creation: string` - `managed_by: optional string` - `name: string` - `parent: optional object { id, name }` - `id: string` - `name: string` - `profile: optional AccountProfile` - `business_address: string` - `business_email: string` - `business_name: string` - `business_phone: string` - `external_metadata: string` - `result_info: object { next_page_token, total_size }` - `next_page_token: optional string` Use this opaque token in the next request to retrieve the next page. Parameters used to filter the retrieved list must remain in subsequent requests with a page token. - `total_size: optional number` Counts the total amount of items in a list with the applied filters. The API omits next_page_token to indicate no more items in a particular list. - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "create_time": "2019-12-27T18:11:19.117Z", "meta": { "flags": { "account_creation": "account_creation", "account_deletion": "account_deletion", "account_migration": "account_migration", "account_mobility": "account_mobility", "sub_org_creation": "sub_org_creation" }, "managed_by": "managed_by" }, "name": "name", "parent": { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "name": "name" }, "profile": { "business_address": "business_address", "business_email": "business_email", "business_name": "business_name", "business_phone": "business_phone", "external_metadata": "external_metadata" } } ], "result_info": { "next_page_token": "next_page_token", "total_size": 0 }, "success": true } ``` ## Get organization **get** `/organizations/{organization_id}` Retrieve the details of a certain organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Path Parameters - `organization_id: string` ### Returns - `errors: array of unknown` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: Organization` References an Organization in the Cloudflare data model. - `id: string` - `create_time: string` - `meta: object { flags, managed_by }` - `flags: optional object { account_creation, account_deletion, account_migration, 2 more }` Enable features for Organizations. - `account_creation: string` - `account_deletion: string` - `account_migration: string` - `account_mobility: string` - `sub_org_creation: string` - `managed_by: optional string` - `name: string` - `parent: optional object { id, name }` - `id: string` - `name: string` - `profile: optional AccountProfile` - `business_address: string` - `business_email: string` - `business_name: string` - `business_phone: string` - `external_metadata: string` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "create_time": "2019-12-27T18:11:19.117Z", "meta": { "flags": { "account_creation": "account_creation", "account_deletion": "account_deletion", "account_migration": "account_migration", "account_mobility": "account_mobility", "sub_org_creation": "sub_org_creation" }, "managed_by": "managed_by" }, "name": "name", "parent": { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "name": "name" }, "profile": { "business_address": "business_address", "business_email": "business_email", "business_name": "business_name", "business_phone": "business_phone", "external_metadata": "external_metadata" } }, "success": true } ``` ## Create organization **post** `/organizations` Create a new organization for a user. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Body Parameters - `name: string` - `parent: optional object { id, name }` - `id: string` - `name: string` - `profile: optional AccountProfile` - `business_address: string` - `business_email: string` - `business_name: string` - `business_phone: string` - `external_metadata: string` ### Returns - `errors: array of unknown` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: Organization` References an Organization in the Cloudflare data model. - `id: string` - `create_time: string` - `meta: object { flags, managed_by }` - `flags: optional object { account_creation, account_deletion, account_migration, 2 more }` Enable features for Organizations. - `account_creation: string` - `account_deletion: string` - `account_migration: string` - `account_mobility: string` - `sub_org_creation: string` - `managed_by: optional string` - `name: string` - `parent: optional object { id, name }` - `id: string` - `name: string` - `profile: optional AccountProfile` - `business_address: string` - `business_email: string` - `business_name: string` - `business_phone: string` - `external_metadata: string` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations \ -H 'Content-Type: application/json' \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ -d '{ "name": "name" }' ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "create_time": "2019-12-27T18:11:19.117Z", "meta": { "flags": { "account_creation": "account_creation", "account_deletion": "account_deletion", "account_migration": "account_migration", "account_mobility": "account_mobility", "sub_org_creation": "sub_org_creation" }, "managed_by": "managed_by" }, "name": "name", "parent": { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "name": "name" }, "profile": { "business_address": "business_address", "business_email": "business_email", "business_name": "business_name", "business_phone": "business_phone", "external_metadata": "external_metadata" } }, "success": true } ``` ## Modify organization. **put** `/organizations/{organization_id}` Modify organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Path Parameters - `organization_id: string` ### Body Parameters - `name: string` - `parent: optional object { id, name }` - `id: string` - `name: string` - `profile: optional AccountProfile` - `business_address: string` - `business_email: string` - `business_name: string` - `business_phone: string` - `external_metadata: string` ### Returns - `errors: array of unknown` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: Organization` References an Organization in the Cloudflare data model. - `id: string` - `create_time: string` - `meta: object { flags, managed_by }` - `flags: optional object { account_creation, account_deletion, account_migration, 2 more }` Enable features for Organizations. - `account_creation: string` - `account_deletion: string` - `account_migration: string` - `account_mobility: string` - `sub_org_creation: string` - `managed_by: optional string` - `name: string` - `parent: optional object { id, name }` - `id: string` - `name: string` - `profile: optional AccountProfile` - `business_address: string` - `business_email: string` - `business_name: string` - `business_phone: string` - `external_metadata: string` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID \ -X PUT \ -H 'Content-Type: application/json' \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ -d '{ "name": "name" }' ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "create_time": "2019-12-27T18:11:19.117Z", "meta": { "flags": { "account_creation": "account_creation", "account_deletion": "account_deletion", "account_migration": "account_migration", "account_mobility": "account_mobility", "sub_org_creation": "sub_org_creation" }, "managed_by": "managed_by" }, "name": "name", "parent": { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "name": "name" }, "profile": { "business_address": "business_address", "business_email": "business_email", "business_name": "business_name", "business_phone": "business_phone", "external_metadata": "external_metadata" } }, "success": true } ``` ## Delete organization. **delete** `/organizations/{organization_id}` Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Path Parameters - `organization_id: string` ### Returns - `errors: array of unknown` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: object { id }` - `id: string` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID \ -X DELETE \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "id" }, "success": true } ``` ## Domain Types ### Organization - `Organization object { id, create_time, meta, 3 more }` References an Organization in the Cloudflare data model. - `id: string` - `create_time: string` - `meta: object { flags, managed_by }` - `flags: optional object { account_creation, account_deletion, account_migration, 2 more }` Enable features for Organizations. - `account_creation: string` - `account_deletion: string` - `account_migration: string` - `account_mobility: string` - `sub_org_creation: string` - `managed_by: optional string` - `name: string` - `parent: optional object { id, name }` - `id: string` - `name: string` - `profile: optional AccountProfile` - `business_address: string` - `business_email: string` - `business_name: string` - `business_phone: string` - `external_metadata: string` ### Organization Delete Response - `OrganizationDeleteResponse object { id }` - `id: string` # Organization Accounts ## Get organization accounts **get** `/organizations/{organization_id}/accounts` Retrieve a list of accounts that belong to a specific organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Path Parameters - `organization_id: string` ### Query Parameters - `account_pubname: optional object { contains, endsWith, startsWith }` - `contains: optional string` (case-insensitive) Filter the list of accounts to where the account_pubname contains a particular string. - `endsWith: optional string` (case-insensitive) Filter the list of accounts to where the account_pubname ends with a particular string. - `startsWith: optional string` (case-insensitive) Filter the list of accounts to where the account_pubname starts with a particular string. - `direction: optional "asc" or "desc"` Sort direction for the order_by field. Valid values: `asc`, `desc`. Defaults to `asc` when order_by is specified. - `"asc"` - `"desc"` - `name: optional object { contains, endsWith, startsWith }` - `contains: optional string` (case-insensitive) Filter the list of accounts to where the name contains a particular string. - `endsWith: optional string` (case-insensitive) Filter the list of accounts to where the name ends with a particular string. - `startsWith: optional string` (case-insensitive) Filter the list of accounts to where the name starts with a particular string. - `order_by: optional "account_name"` Field to order results by. Currently supported values: `account_name`. When not specified, results are ordered by internal account ID. - `"account_name"` - `page_size: optional number` The amount of items to return. Defaults to 10. - `page_token: optional string` An opaque token returned from the last list response that when provided will retrieve the next page. Parameters used to filter the retrieved list must remain in subsequent requests with a page token. ### Returns - `errors: array of unknown` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: array of object { id, created_on, name, 2 more }` - `id: string` - `created_on: string` - `name: string` - `settings: object { abuse_contact_email, access_approval_expiry, api_access_enabled, 3 more }` - `abuse_contact_email: string` - `access_approval_expiry: string` - `api_access_enabled: boolean` - `default_nameservers: string` Use [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-list-dns-settings) instead. Deprecated. - `enforce_twofactor: boolean` - `use_account_custom_ns_by_default: boolean` Use [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-list-dns-settings) instead. Deprecated. - `type: "standard" or "enterprise"` - `"standard"` - `"enterprise"` - `result_info: object { next_page_token, total_size }` - `next_page_token: optional string` Use this opaque token in the next request to retrieve the next page. Parameters used to filter the retrieved list must remain in subsequent requests with a page token. - `total_size: optional number` Counts the total amount of items in a list with the applied filters. The API omits next_page_token to indicate no more items in a particular list. - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID/accounts \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "name": "name", "settings": { "abuse_contact_email": "abuse_contact_email", "access_approval_expiry": "2019-12-27T18:11:19.117Z", "api_access_enabled": true, "default_nameservers": "default_nameservers", "enforce_twofactor": true, "use_account_custom_ns_by_default": true }, "type": "standard" } ], "result_info": { "next_page_token": "next_page_token", "total_size": 0 }, "success": true } ``` ## Domain Types ### Organization Accounts - `OrganizationAccounts object { id, name, type, 3 more }` - `id: string` Identifier - `name: string` Account name - `type: "standard" or "enterprise"` - `"standard"` - `"enterprise"` - `created_on: optional string` Timestamp for the creation of the account - `managed_by: optional object { parent_org_id, parent_org_name }` Parent container details - `parent_org_id: optional string` ID of the parent Organization, if one exists - `parent_org_name: optional string` Name of the parent Organization, if one exists - `settings: optional object { abuse_contact_email, enforce_twofactor }` Account settings - `abuse_contact_email: optional string` Sets an abuse contact email to notify for abuse reports. - `enforce_twofactor: optional boolean` Indicates whether membership in this account requires that Two-Factor Authentication is enabled ### Organization Account Get Response - `OrganizationAccountGetResponse = array of object { id, created_on, name, 2 more }` - `id: string` - `created_on: string` - `name: string` - `settings: object { abuse_contact_email, access_approval_expiry, api_access_enabled, 3 more }` - `abuse_contact_email: string` - `access_approval_expiry: string` - `api_access_enabled: boolean` - `default_nameservers: string` Use [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-list-dns-settings) instead. Deprecated. - `enforce_twofactor: boolean` - `use_account_custom_ns_by_default: boolean` Use [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-list-dns-settings) instead. Deprecated. - `type: "standard" or "enterprise"` - `"standard"` - `"enterprise"` # Organization Profile ## Get organization profile **get** `/organizations/{organization_id}/profile` Get an organizations profile if it exists. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Path Parameters - `organization_id: string` ### Returns - `errors: array of unknown` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: AccountProfile` - `business_address: string` - `business_email: string` - `business_name: string` - `business_phone: string` - `external_metadata: string` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID/profile \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "business_address": "business_address", "business_email": "business_email", "business_name": "business_name", "business_phone": "business_phone", "external_metadata": "external_metadata" }, "success": true } ``` ## Modify organization profile. **put** `/organizations/{organization_id}/profile` Modify organization profile. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Path Parameters - `organization_id: string` ### Body Parameters - `business_address: string` - `business_email: string` - `business_name: string` - `business_phone: string` - `external_metadata: string` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID/profile \ -X PUT \ -H 'Content-Type: application/json' \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ -d '{ "business_address": "business_address", "business_email": "business_email", "business_name": "business_name", "business_phone": "business_phone", "external_metadata": "external_metadata" }' ``` ## Domain Types ### Organization Profile - `OrganizationProfile object { business_address, business_email, business_name, 2 more }` - `business_address: string` - `business_email: string` - `business_name: string` - `business_phone: string` - `external_metadata: string` # Members ## List organization members **get** `/organizations/{organization_id}/members` List memberships for an Organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Path Parameters - `organization_id: string` ### Query Parameters - `page_size: optional number` The amount of items to return. Defaults to 10. - `page_token: optional string` An opaque token returned from the last list response that when provided will retrieve the next page. Parameters used to filter the retrieved list must remain in subsequent requests with a page token. - `status: optional array of "active" or "canceled"` Filter the list of memberships by membership status. - `"active"` - `"canceled"` - `user: optional object { email }` - `email: optional string` Filter the list of memberships for a specific email that ends with a substring. ### Returns - `errors: array of unknown` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: array of OrganizationMember` - `id: string` Organization Member ID - `create_time: string` - `meta: map[unknown]` - `status: "active" or "canceled"` - `"active"` - `"canceled"` - `update_time: string` - `user: object { id, email, name, two_factor_authentication_enabled }` - `id: string` - `email: string` - `name: string` - `two_factor_authentication_enabled: boolean` - `result_info: object { next_page_token, total_size }` - `next_page_token: optional string` Use this opaque token in the next request to retrieve the next page. Parameters used to filter the retrieved list must remain in subsequent requests with a page token. - `total_size: optional number` Counts the total amount of items in a list with the applied filters. The API omits next_page_token to indicate no more items in a particular list. - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID/members \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "create_time": "2019-12-27T18:11:19.117Z", "meta": { "foo": {} }, "status": "active", "update_time": "2019-12-27T18:11:19.117Z", "user": { "id": "id", "email": "email", "name": "name", "two_factor_authentication_enabled": true } } ], "result_info": { "next_page_token": "next_page_token", "total_size": 0 }, "success": true } ``` ## Get organization member **get** `/organizations/{organization_id}/members/{member_id}` Retrieve a single membership from an Organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Path Parameters - `organization_id: string` - `member_id: string` Organization Member ID ### Returns - `errors: array of unknown` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: OrganizationMember` - `id: string` Organization Member ID - `create_time: string` - `meta: map[unknown]` - `status: "active" or "canceled"` - `"active"` - `"canceled"` - `update_time: string` - `user: object { id, email, name, two_factor_authentication_enabled }` - `id: string` - `email: string` - `name: string` - `two_factor_authentication_enabled: boolean` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID/members/$MEMBER_ID \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "create_time": "2019-12-27T18:11:19.117Z", "meta": { "foo": {} }, "status": "active", "update_time": "2019-12-27T18:11:19.117Z", "user": { "id": "id", "email": "email", "name": "name", "two_factor_authentication_enabled": true } }, "success": true } ``` ## Create organization member **post** `/organizations/{organization_id}/members` Create a membership that grants access to a specific Organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Path Parameters - `organization_id: string` ### Body Parameters - `member: object { user, status }` - `user: object { email }` - `email: string` - `status: optional "active" or "canceled"` - `"active"` - `"canceled"` ### Returns - `errors: array of unknown` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: OrganizationMember` - `id: string` Organization Member ID - `create_time: string` - `meta: map[unknown]` - `status: "active" or "canceled"` - `"active"` - `"canceled"` - `update_time: string` - `user: object { id, email, name, two_factor_authentication_enabled }` - `id: string` - `email: string` - `name: string` - `two_factor_authentication_enabled: boolean` - `success: true` - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID/members \ -H 'Content-Type: application/json' \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ -d '{ "member": { "user": { "email": "email" } } }' ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", "create_time": "2019-12-27T18:11:19.117Z", "meta": { "foo": {} }, "status": "active", "update_time": "2019-12-27T18:11:19.117Z", "user": { "id": "id", "email": "email", "name": "name", "two_factor_authentication_enabled": true } }, "success": true } ``` ## Delete organization member **delete** `/organizations/{organization_id}/members/{member_id}` Delete a membership to a particular Organization. (Currently in Closed Beta - see https://developers.cloudflare.com/fundamentals/organizations/) ### Path Parameters - `organization_id: string` - `member_id: string` Organization Member ID ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID/members/$MEMBER_ID \ -X DELETE \ -H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ -H "X-Auth-Key: $CLOUDFLARE_API_KEY" ``` ## Domain Types ### Organization Member - `OrganizationMember object { id, create_time, meta, 3 more }` - `id: string` Organization Member ID - `create_time: string` - `meta: map[unknown]` - `status: "active" or "canceled"` - `"active"` - `"canceled"` - `update_time: string` - `user: object { id, email, name, two_factor_authentication_enabled }` - `id: string` - `email: string` - `name: string` - `two_factor_authentication_enabled: boolean` # Logs # Audit ## Get organization audit logs (Version 2, Beta release) **get** `/organizations/{organization_id}/logs/audit` Gets a list of audit logs for an organization. ### Path Parameters - `organization_id: string` The unique id that identifies the organization. ### Query Parameters - `before: string` Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339. - `since: string` Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339. - `id: optional object { not }` - `not: optional array of string` Filters out audit logs by their IDs. - `action_result: optional object { not }` - `not: optional array of "success" or "failure"` Filters out audit logs by whether the action was successful or not. - `"success"` - `"failure"` - `action_type: optional object { not }` - `not: optional array of "create" or "delete" or "view" or "update"` Filters out audit logs by the action type. - `"create"` - `"delete"` - `"view"` - `"update"` - `actor_context: optional object { not }` - `not: optional array of "api_key" or "api_token" or "dash" or 2 more` Filters out audit logs by the actor context. - `"api_key"` - `"api_token"` - `"dash"` - `"oauth"` - `"origin_ca_key"` - `actor_email: optional object { not }` - `not: optional array of string` Filters out audit logs by the actor's email address. - `actor_id: optional object { not }` - `not: optional array of string` Filters out audit logs by the actor's user ID. - `actor_ip_address: optional object { not }` - `not: optional array of string` Filters out audit logs IP address where the action was initiated. - `actor_token_id: optional object { not }` - `not: optional array of string` Filters out audit logs by the API token ID when the actor context is an api_token or oauth. - `actor_token_name: optional object { not }` - `not: optional array of string` Filters out audit logs by the API token name when the actor context is an api_token or oauth. - `actor_type: optional object { not }` - `not: optional array of "cloudflare_admin" or "system" or "user"` Filters out audit logs by the actor type. - `"cloudflare_admin"` - `"system"` - `"user"` - `cursor: optional string` The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response. - `direction: optional "desc" or "asc"` Sets sorting order. - `"desc"` - `"asc"` - `limit: optional number` The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit. - `raw_cf_ray_id: optional object { not }` - `not: optional array of string` Filters out audit logs by the response CF Ray ID. - `raw_method: optional object { not }` - `not: optional array of string` Filters out audit logs by the HTTP method for the API call. - `raw_status_code: optional object { not }` - `not: optional array of number` Filters out audit logs by the response status code that was returned. - `raw_uri: optional object { not }` - `not: optional array of string` Filters out audit logs by the request URI. - `resource_id: optional object { not }` - `not: optional array of string` Filters out audit logs by the resource ID. - `resource_product: optional object { not }` - `not: optional array of string` Filters out audit logs by the Cloudflare product associated with the changed resource. - `resource_scope: optional object { not }` - `not: optional array of "organizations"` Filters out audit logs by the resource scope, specifying whether the resource is associated with an organization. - `"organizations"` - `resource_type: optional object { not }` - `not: optional array of string` Filters out audit logs based on the unique type of resource changed by the action. ### Returns - `errors: optional array of object { message }` - `message: string` - `result: optional array of object { id, action, actor, 3 more }` - `id: optional string` A unique identifier for the audit log entry. - `action: optional object { description, result, time, type }` Provides information about the action performed. - `description: optional string` A short description of the action performed. - `result: optional string` The result of the action, indicating success or failure. - `time: optional string` A timestamp indicating when the action was logged. - `type: optional string` A short string that describes the action that was performed. - `actor: optional object { id, context, email, 4 more }` Provides details about the actor who performed the action. - `id: optional string` The ID of the actor who performed the action. If a user performed the action, this will be their User ID. - `context: optional "api_key" or "api_token" or "dash" or 2 more` - `"api_key"` - `"api_token"` - `"dash"` - `"oauth"` - `"origin_ca_key"` - `email: optional string` The email of the actor who performed the action. - `ip_address: optional string` The IP address of the request that performed the action. - `token_id: optional string` The API token ID when the actor context is an api_token or oauth. - `token_name: optional string` The API token name when the actor context is an api_token or oauth. - `type: optional "cloudflare_admin" or "system" or "user"` The type of actor. - `"cloudflare_admin"` - `"system"` - `"user"` - `organization: optional object { id }` Contains organization related information. - `id: optional string` A unique identifier for the organization. - `raw: optional object { cf_ray_id, method, status_code, 2 more }` Provides raw information about the request and response. - `cf_ray_id: optional string` The Cloudflare Ray ID for the request. - `method: optional string` The HTTP method of the request. - `status_code: optional number` The HTTP response status code returned by the API. - `uri: optional string` The URI of the request. - `user_agent: optional string` The client's user agent string sent with the request. - `resource: optional object { id, product, request, 3 more }` Provides details about the affected resource. - `id: optional string` The unique identifier for the affected resource. - `product: optional string` The Cloudflare product associated with the resource. - `request: optional unknown` - `response: optional unknown` - `scope: optional unknown` The scope of the resource. - `type: optional string` The type of the resource. - `result_info: optional object { count, cursor }` Provides information about the result of the request, including count and cursor. - `count: optional string` The number of records returned in the response. - `cursor: optional string` The cursor token used for pagination. - `success: optional true` Indicates whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/organizations/$ORGANIZATION_ID/logs/audit \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "errors": [ { "message": "message" } ], "result": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "action": { "description": "Add Member", "result": "success", "time": "2024-04-26T17:31:07Z", "type": "create" }, "actor": { "id": "f6b5de0326bb5182b8a4840ee01ec774", "context": "dash", "email": "alice@example.com", "ip_address": "198.41.129.166", "token_id": "token_id", "token_name": "token_name", "type": "user" }, "organization": { "id": "019c4f65e7607d8c9f6f6b58aa3aff50" }, "raw": { "cf_ray_id": "8e9b1c60ef9e1c9a", "method": "POST", "status_code": 200, "uri": "/accounts/4bb334f7c94c4a29a045f03944f072e5/members", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Safari/605.1.15" }, "resource": { "id": "id", "product": "organizations", "request": {}, "response": {}, "scope": {}, "type": "type" } } ], "result_info": { "count": "1", "cursor": "ASqdKd7dKgxh-aZ8bm0mZos1BtW4BdEqifCzNkEeGRzi_5SN_-362Y8sF-C1TRn60_6rd3z2dIajf9EAPyQ_NmIeAMkacmaJPXipqvP7PLU4t72wyqBeJfjmjdE=" }, "success": true } ``` ## Domain Types ### Audit List Response - `AuditListResponse object { id, action, actor, 3 more }` - `id: optional string` A unique identifier for the audit log entry. - `action: optional object { description, result, time, type }` Provides information about the action performed. - `description: optional string` A short description of the action performed. - `result: optional string` The result of the action, indicating success or failure. - `time: optional string` A timestamp indicating when the action was logged. - `type: optional string` A short string that describes the action that was performed. - `actor: optional object { id, context, email, 4 more }` Provides details about the actor who performed the action. - `id: optional string` The ID of the actor who performed the action. If a user performed the action, this will be their User ID. - `context: optional "api_key" or "api_token" or "dash" or 2 more` - `"api_key"` - `"api_token"` - `"dash"` - `"oauth"` - `"origin_ca_key"` - `email: optional string` The email of the actor who performed the action. - `ip_address: optional string` The IP address of the request that performed the action. - `token_id: optional string` The API token ID when the actor context is an api_token or oauth. - `token_name: optional string` The API token name when the actor context is an api_token or oauth. - `type: optional "cloudflare_admin" or "system" or "user"` The type of actor. - `"cloudflare_admin"` - `"system"` - `"user"` - `organization: optional object { id }` Contains organization related information. - `id: optional string` A unique identifier for the organization. - `raw: optional object { cf_ray_id, method, status_code, 2 more }` Provides raw information about the request and response. - `cf_ray_id: optional string` The Cloudflare Ray ID for the request. - `method: optional string` The HTTP method of the request. - `status_code: optional number` The HTTP response status code returned by the API. - `uri: optional string` The URI of the request. - `user_agent: optional string` The client's user agent string sent with the request. - `resource: optional object { id, product, request, 3 more }` Provides details about the affected resource. - `id: optional string` The unique identifier for the affected resource. - `product: optional string` The Cloudflare product associated with the resource. - `request: optional unknown` - `response: optional unknown` - `scope: optional unknown` The scope of the resource. - `type: optional string` The type of the resource.