WorkOS user-management.cors-origins API

Manage CORS origins for user management.

OpenAPI Specification

workos-user-management-cors-origins-api-openapi.yml Raw ↑
openapi: 3.1.1
info:
  title: WorkOS admin-portal user-management.cors-origins API
  description: WorkOS REST API
  version: '1.0'
  contact:
    name: WorkOS
    url: https://workos.com
    email: support@workos.com
  license:
    name: MIT
    url: https://opensource.org/license/MIT
servers:
- url: https://api.workos.com
  description: Production
- url: https://api.workos-test.com
  description: Staging
security:
- bearer: []
tags:
- name: user-management.cors-origins
  description: Manage CORS origins for user management.
  x-displayName: CORS Origins
paths:
  /user_management/cors_origins:
    post:
      description: Creates a new CORS origin for the current environment. CORS origins allow browser-based applications to make requests to the WorkOS API.
      operationId: CorsOriginsController_createCorsOrigin
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCorsOriginDto'
      responses:
        '201':
          description: CORS origin created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CorsOriginResponse'
        '409':
          description: Duplicate CORS origin.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: The error code.
                    example: duplicate_cors_origin
                  message:
                    type: string
                    description: A human-readable error message.
                    example: CORS origin already exists.
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A human-readable error message.
                    example: Validation failed.
                  errors:
                    type: array
                    description: The list of validation errors.
                    items:
                      type: object
                      properties:
                        property:
                          type: string
                          description: The property that failed validation.
                          example: origin
                        constraints:
                          type: object
      summary: Create a CORS Origin
      tags:
      - user-management.cors-origins
components:
  schemas:
    CreateCorsOriginDto:
      type: object
      properties:
        origin:
          type: string
          description: The origin URL to allow for CORS requests.
          example: https://example.com
      required:
      - origin
    CorsOriginResponse:
      type: object
      properties:
        object:
          type: string
          description: Distinguishes the CORS origin object.
          const: cors_origin
        id:
          type: string
          description: Unique identifier of the CORS origin.
          example: cors_origin_01HXYZ123456789ABCDEFGHIJ
        origin:
          type: string
          description: The origin URL.
          example: https://example.com
        created_at:
          type: string
          format: date-time
          description: Timestamp when the CORS origin was created.
          example: '2026-01-15T12:00:00.000Z'
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the CORS origin was last updated.
          example: '2026-01-15T12:00:00.000Z'
      required:
      - object
      - id
      - origin
      - created_at
      - updated_at
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: 'Your WorkOS API key prefixed with `sk_`. Pass it as a Bearer token: `Authorization: Bearer sk_example_123456789`.'
    access_token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: An SSO access token returned from the Get a Profile and Token endpoint.