RecoupGet a free auditFree audit

API REFERENCE

Create Organization

On this page
POST/api/organizations

Create a new organization. The creator is automatically added as a member of the organization.

Authentication

x-api-key in header

bearerAuth bearer

Request

cURL
curl --request POST \
  --url 'https://api.recoupable.dev/api/organizations' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "My New Label",
  "accountId": "123e4567-e89b-12d3-a456-426614174000"
}'

Try it

Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.

Kept in this browser tab only and cleared when it closes.

cURL for this request
curl --request POST \
  --url 'https://recoup-api.vercel.app/api/organizations' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "My New Label",
  "accountId": "123e4567-e89b-12d3-a456-426614174000"
}'

Request body required

Organization creation parameters

application/json

namestringrequired

The name of the organization to create

accountIdstringrequired

The account ID of the creator

format: uuid

Responses

200Organization created successfully

application/json

statusstring · enumrequired

Status of the request

Values: "success"

organizationobjectrequired

The created organization

Properties for organization
idstring

UUID of the new organization account

format: uuid

namestring

Name of the organization

400Bad request - missing required parameters

application/json

statusstring · enumrequired

Status of the request

Values: "error"

messagestringrequired

Error message describing what went wrong

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download accounts.json
View operation source
json
{
  "description": "Create a new organization. The creator is automatically added as a member of the organization.",
  "security": [
    {
      "apiKeyAuth": []
    },
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "description": "Organization creation parameters",
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreateOrganizationRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Organization created successfully",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CreateOrganizationResponse"
          }
        }
      }
    },
    "400": {
      "description": "Bad request - missing required parameters",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/OrganizationsErrorResponse"
          }
        }
      }
    }
  }
}