RecoupGet a free auditFree audit

API REFERENCE

Add Member to Organization

On this page
POST/api/organizations/members

Add a member to an organization. This endpoint is idempotent - Adding an existing member returns the existing membership.

Authentication

x-api-key in header

bearerAuth bearer

Request

cURL
curl --request POST \
  --url 'https://api.recoupable.dev/api/organizations/members' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "organizationId": "YOUR_ID"
}'

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/members' \
  --header 'Content-Type: application/json' \
  --data '{
  "organizationId": "YOUR_ID"
}'

Request body required

Member-organization association parameters

application/json

organizationIdstringrequired

The account ID of the organization

format: uuid

accountIdstring

The account ID of the member to add. Provide exactly one of accountId or email.

format: uuid

emailstring

Email of the member to add. The account is created if it does not exist yet. Provide exactly one of accountId or email.

format: email

Responses

200Member added to organization successfully (or already a member)

application/json

statusstring · enumrequired

Status of the request

Values: "success"

idstringrequired

UUID of the membership record

format: uuid

account_idstringrequired

The account ID of the member (resolved from email when email was provided)

format: uuid

400Bad request - invalid or missing parameters

application/json

statusstring · enumrequired

Status of the request

Values: "error"

errorstringrequired

Error message describing what went wrong

401Unauthorized - missing or invalid authentication

application/json

statusstring · enumrequired

Status of the request

Values: "error"

errorstringrequired

Error message describing what went wrong

403Forbidden - caller is not a member of the organization

application/json

statusstring · enumrequired

Status of the request

Values: "error"

errorstringrequired

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": "Add a member to an organization. This endpoint is idempotent - Adding an existing member returns the existing membership.",
  "security": [
    {
      "apiKeyAuth": []
    },
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "description": "Member-organization association parameters",
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AddOrganizationMemberRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Member added to organization successfully (or already a member)",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/AddOrganizationMemberResponse"
          }
        }
      }
    },
    "400": {
      "description": "Bad request - invalid or missing parameters",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        }
      }
    },
    "401": {
      "description": "Unauthorized - missing or invalid authentication",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        }
      }
    },
    "403": {
      "description": "Forbidden - caller is not a member of the organization",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorEnvelope"
          }
        }
      }
    }
  }
}