ZeroTier organizations API

Organization management. Note: Organizations require a paid account and cannot be created via the API

OpenAPI Specification

zerotier-organizations-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  description: 'ZeroTier Central Network Management Portal API.<p>All API requests must have an API token header specified in the <code>Authorization: token xxxxx</code> format.  You can generate your API key by logging into <a href="https://my.zerotier.com">ZeroTier Central</a> and creating a token on the Account page.</p><p>eg. <code>curl -X GET -H "Authorization: token xxxxx" https://api.zerotier.com/api/v1/network</code></p><p><h3>Rate Limiting</h3></p><p>The ZeroTier Central API implements rate limiting.  Paid users are limited to 100 requests per second.  Free users are limited to 20 requests per second.</p> <p> You can get the OpenAPI spec here as well: <code>https://docs.zerotier.com/api/central/ref-v1.json</code></p>'
  version: v1
  title: ZeroTier Central controller organizations API
  contact:
    name: ZeroTier Support Discussion Forum
    url: https://discuss.zerotier.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://api.zerotier.com/api/v1
  description: Production Server
security:
- tokenAuth: []
tags:
- name: organizations
  description: 'Organization management. Note: Organizations require a paid account and cannot be created via the API'
paths:
  /org:
    get:
      tags:
      - organizations
      operationId: getOrganization
      summary: Get the current user's organization
      responses:
        '200':
          description: Get my organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/AccessDeniedError'
        '404':
          $ref: '#/components/responses/NotFound'
  /org/{orgID}:
    get:
      tags:
      - organizations
      operationId: getOrganizationByID
      summary: Get organization by ID
      parameters:
      - name: orgID
        description: Organization ID
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/AccessDeniedError'
        '404':
          $ref: '#/components/responses/NotFound'
  /org/{orgID}/user:
    get:
      tags:
      - organizations
      operationId: getOrganizationMembers
      summary: Get list of organization members
      parameters:
      - name: orgID
        description: Organization ID
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Get organization members success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationMember'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/AccessDeniedError'
        '404':
          $ref: '#/components/responses/NotFound'
  /org-invitation:
    get:
      tags:
      - organizations
      operationId: getOrganizationInvitationList
      summary: Get list of organization invitations
      responses:
        '200':
          description: Get list of invitations
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrganizationInvitation'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/AccessDeniedError'
        '404':
          $ref: '#/components/responses/NotFound'
    post:
      tags:
      - organizations
      operationId: inviteUserByEmail
      summary: Invite a user to your organization by email
      requestBody:
        description: Organization Invitation JSON object
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganizationInvitation'
      responses:
        '200':
          description: User invited to organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationInvitation'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/AccessDeniedError'
        '404':
          $ref: '#/components/responses/NotFound'
  /org-invitation/{inviteID}:
    get:
      tags:
      - organizations
      operationId: getInvitationByID
      summary: Get organization invitation
      parameters:
      - name: inviteID
        description: Invitation ID
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Get organization invitation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationInvitation'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/AccessDeniedError'
        '404':
          $ref: '#/components/responses/NotFound'
    post:
      tags:
      - organizations
      operationId: acceptInvitation
      summary: Accept organization invitation
      parameters:
      - name: inviteID
        description: Invitation ID
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Organization invitation accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationInvitation'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/AccessDeniedError'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      tags:
      - organizations
      operationId: declineInvitation
      summary: Decline organization invitation
      parameters:
      - name: inviteID
        description: Invitation ID
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: organization invitation declined
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/AccessDeniedError'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    OrgSsoConfig:
      type: object
      properties:
        enabled:
          type: boolean
          example: true
          description: Enabled flag for SSO
        issuers:
          type: array
          items:
            $ref: '#/components/schemas/SsoIssuer'
            description: list of configured OIDC issuers
    OrganizationInvitation:
      type: object
      properties:
        orgId:
          type: string
          description: Organization ID
          example: 00000000-0000-0000-0000-000000000000
          readOnly: true
        email:
          type: string
          description: Email address of invitee
          example: joe@user.com
        id:
          type: string
          description: Invitation ID
          example: 00000000-0000-0000-0000-000000000000
          readOnly: true
        creation_time:
          type: integer
          format: int64
          description: Creation time of the invite
          example: 1613067920454
          readOnly: true
        status:
          readOnly: true
          description: Invitation status
          example: pending
          allOf:
          - $ref: '#/components/schemas/InviteStatus'
        update_time:
          type: integer
          format: int64
          description: Last updated time of the invitation
          example: 1613067920454
          readOnly: true
        ownerEmail:
          type: string
          description: Organization owner email address
          example: user@example.com
          readOnly: true
    OrganizationMember:
      type: object
      properties:
        orgId:
          type: string
          readOnly: true
          description: Organization ID
          example: 00000000-0000-0000-0000-000000000000
        userId:
          type: string
          readOnly: false
          description: User ID
          example: 00000000-0000-0000-0000-000000000000
        name:
          type: string
          readOnly: true
          nullable: true
          description: Organization member display name
          example: Joe User
        email:
          type: string
          readOnly: true
          nullable: true
          description: Organization member email address
    InviteStatus:
      type: string
      enum:
      - pending
      - accepted
      - canceled
    Organization:
      type: object
      properties:
        id:
          type: string
          example: 00000000-0000-0000-0000-000000000000
          description: Organization ID
        ownerId:
          type: string
          description: User ID of the organization owner
          example: 00000000-0000-0000-0000-000000000000
          readOnly: true
        ownerEmail:
          type: string
          description: Organization owner's email address
          example: user@example.com
          readOnly: true
        members:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationMember'
          description: List of organization members
        ssoConfig:
          type: object
          $ref: '#/components/schemas/OrgSsoConfig'
          description: Organization wide SSO configuration
    SsoIssuer:
      type: object
      properties:
        provider:
          type: string
          example: keycloak
          description: 'OIDC Provider (one of: default, authelia, auth0, azure, keycloak, okta, onelogin)'
        clientId:
          type: string
          example: oidc-client-id
          description: OIDC Client ID
        issuer:
          type: string
          example: https://example.com/oidc/auth
          description: OIDC Issuer URL
        authorization_endpoint:
          type: string
          example: https://example.com/oidc/auth/endpoint
          description: authorization endpoint
          readOnly: true
  responses:
    AccessDeniedError:
      description: Access denied
    UnauthorizedError:
      description: Authorization required
    NotFound:
      description: Item not found
  securitySchemes:
    tokenAuth:
      type: http
      scheme: token