Skip to main content
POST
/
v1
/
org
Create organization
curl --request POST \
  --url https://api.twine.se/v1/org \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "AcmeCorp Inc.",
  "owner_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
  "roles": [
    {
      "admin": false,
      "api_refresh_token_ttl": 7776000,
      "assign_to": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
      "create_api_refresh_token": true,
      "create_in": "parent",
      "name": "Employee API Role"
    }
  ],
  "suppression_ends_at": "2026-05-01T00:00:00Z",
  "suppression_reason": "onboarding",
  "vat": "SE556677889901"
}
'
{
  "data": {
    "org_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
    "custom_properties": [
      {
        "domain": "employee",
        "id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
        "property": "shoe_size",
        "type": "enum",
        "description": "The size of the employee's shoes",
        "list": false,
        "reference_domain": "employee"
      }
    ],
    "delete_protection": true,
    "delete_protection_disabled_at": "2021-06-01T12:00:00Z",
    "name": "AcmeCorp Inc.",
    "owner_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
    "parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
    "roles": [
      {
        "id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
        "name": "Admin Role",
        "tokens": [
          {
            "exp": 1672531199,
            "jti": "<string>",
            "jwt": "s3cr3t-t0k3n",
            "typ": "access"
          }
        ]
      }
    ],
    "vat": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
  }
}

Authorizations

Authorization
string
header
required

Bearer token for authentication

Body

application/json

Organization Create Request

Payload for creating an Organization in Twine.

name
string
required

The organization's name

Example:

"AcmeCorp Inc."

owner_id
string<uuid>

The UUID of the user who will own the organization in Twine. This user must exist in the same organization as the role being used to create the new organization.

Example:

"018eae56-8f9d-7ca0-bea3-17f3db6cf75b"

roles
OrganizationCreateRole · object[] | null

Roles to create in the new organization

suppression_ends_at
string<date-time> | null

If set, a breaker suppression is created for the new organization (scope :organization) ending at this timestamp. Auto-trip sources (error-rate, change-magnitude) are silenced for this org and its descendants until then. Useful for onboarding windows where signal noise is expected.

Example:

"2026-05-01T00:00:00Z"

suppression_reason
string | null

Free-form reason recorded on the suppression row. Ignored if suppression_ends_at is not set.

Example:

"onboarding"

vat
string | null

The organization's VAT number

Example:

"SE556677889901"

Response

Organization Response

A response object with a single organization

data
Organization · object
required

An object representing an organization in Twine. Please note that the primary key for organizations is org_id, not id.