Skip to content

Create an organization.

Method

POST https://papi.afi.ai/api/v1/orgs

Description

Creates a new child organization.

Query params
parent_org_id string

ID of the existing parent organization.

external_id string

External ID for the new organization. Use it for idempotency to prevent duplicate organizations and to map the organization to the matching one in an external system that integrates with Afi.

name string

Name of the new organization.

admin_email string

Email address of the administrator account. An email with an invitation link is sent to this address.

curl -X POST \
    -H 'Authorization: {api-key}' \
    https://papi.afi.ai/api/v1/orgs

Successful response (200) schema
object

CreateOrgResult is the result of an organization creation request.

org object

The newly created organization.

object

Org represents an organization.

id string

Unique ID of the organization.

external_id string

Unique external ID of the organization.

kind string

Organization kind (distributor, msp, basic).

name string

Organization name.

invitation_url string

An invitation URL that the user can follow to log in, accepting the invitation, and become the organization's administrator.

Response example
{
  "org": {
    "id": "string",
    "external_id": "string",
    "kind": "string",
    "name": "string"
  },
  "invitation_url": "string"
}