API REFERENCE
Add Member to Organization
On this page
/api/organizations/membersAdd 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 --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"
}'Request body required
Member-organization association parameters
application/json
organizationIdstringrequiredThe account ID of the organization
format: uuid
accountIdstringThe account ID of the member to add. Provide exactly one of accountId or email.
format: uuid
emailstringEmail 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 · enumrequiredStatus of the request
Values: "success"
idstringrequiredUUID of the membership record
format: uuid
account_idstringrequiredThe account ID of the member (resolved from email when email was provided)
format: uuid
400Bad request - invalid or missing parameters+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredError message describing what went wrong
401Unauthorized - missing or invalid authentication+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredError message describing what went wrong
403Forbidden - caller is not a member of the organization+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredError message describing what went wrong
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download accounts.jsonView operation source
{
"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"
}
}
}
}
}
}