Skip to main content

Create Organization

Creates a new organization — the top-level tenant entity that owns docks, parties, and machine clients.
POST /v1/organizations

Request Body

ParameterTypeRequiredDescription
namestringRequiredDisplay name for the organization
metadataobjectOptionalCustom JSON attributes (e.g., {"industry": "financial-services"})

Example Request

curl -X POST https://api.docyard.io/v1/organizations \
  -H "Authorization: Bearer dk_live_a1b2c3d4..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Bank of America",
    "metadata": {
      "industry": "financial-services",
      "region": "north-america",
      "tier": "enterprise"
    }
  }'

Response

{
  "id": "org_01HQ3K9B2...",
  "name": "Bank of America",
  "slug": "bank-of-america",
  "metadata": {
    "industry": "financial-services",
    "region": "north-america",
    "tier": "enterprise"
  },
  "createdAt": "2024-03-01T12:00:00.000Z",
  "updatedAt": "2024-03-01T12:00:00.000Z",
  "_count": {
    "docks": 0,
    "parties": 0,
    "machineClients": 0
  }
}

Response Fields

FieldTypeDescription
idstringUnique organization identifier (prefix: org_)
namestringOrganization display name
slugstringURL-friendly unique identifier (auto-generated from name)
metadataobjectCustom JSON attributes
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp
_countobjectResource counts (docks, parties, machine clients)

Error Handling

StatusCondition
400Invalid request body
401Missing or invalid API key
409Organization name or slug already exists
The slug is automatically generated from the organization name. If “Bank of America” already exists, the next one might be “bank-of-america-1”.

Next Steps

After creating an organization:
  1. Create a dock under this organization
  2. Create parties for real-world actors
  3. Create machine clients for automated integrations