API REFERENCE
Add Organization Domain
On this page
/api/organizations/domainsMap an email domain to an organization for automatic membership. After mapping, any account that signs up (or signs in) with an email at this domain is automatically added to the organization. A domain can belong to at most one organization. This endpoint is idempotent - re-adding the same domain to the same organization returns the existing mapping.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request POST \
--url 'https://api.recoupable.dev/api/organizations/domains' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"organizationId": "YOUR_ID",
"domain": "seekermusic.com"
}'Request body required
Domain-organization mapping parameters
application/json
organizationIdstringrequiredThe account ID of the organization
format: uuid
domainstringrequiredThe email domain to map (lowercase, no @)
Responses
200Domain mapped to organization successfully (or already mapped)+
application/json
statusstring · enumrequiredStatus of the request
Values: "success"
idstringrequiredUUID of the domain mapping record
format: uuid
domainstringrequiredThe mapped email domain
organization_idstringrequiredThe account ID of the organization
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
409Conflict - domain is already mapped to a different 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": "Map an email domain to an organization for automatic membership. After mapping, any account that signs up (or signs in) with an email at this domain is automatically added to the organization. A domain can belong to at most one organization. This endpoint is idempotent - re-adding the same domain to the same organization returns the existing mapping.",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"requestBody": {
"description": "Domain-organization mapping parameters",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AddOrganizationDomainRequest"
}
}
}
},
"responses": {
"200": {
"description": "Domain mapped to organization successfully (or already mapped)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AddOrganizationDomainResponse"
}
}
}
},
"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"
}
}
}
},
"409": {
"description": "Conflict - domain is already mapped to a different organization",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
}
}
}
}