create an organization.md
Create an organization
Management API · Organization
POST https://app.mk.io/api/v1/organization
Create a new Organization.
The user will be added to the newly created Organization.
Optionally the legal information can also be entered at this point.
NOTE: Organization names are not unique so care must be taken to avoid creating duplicates.
RBAC Capability Required: core.customer.create
Authentication
Authorizationheader — Bearer authentication of the formBearer <token>.
Request body
Content type: application/json
spec· object · Required — SpecificationlegalEntityAddress· string · Optional — The legal address of the purchaser.legalEntityContactEmail· string · Optional — The primary officer's email address.legalEntityName· string · Optional — The legal entity name of the purchaser.legalEntityOfficer· string · Optional — The name of the primary officer of the purchaser.name· string · Required · <=512 characters — Name of the organization.
Example request
curl -X POST "https://app.mk.io/api/v1/organization" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"spec": {
"legalEntityAddress": "string",
"legalEntityContactEmail": "string",
"legalEntityName": "string",
"legalEntityOfficer": "string",
"name": "string"
}
}'
Responses
201 — Created
kind· string · Optional — The kind of record.metadata· object · Optional — Metadatacreated· string · Optional · format: date-time — The time when the resource was createdcreatedBy· string · Optional · format: uuid — ID of the user who created the resourcecreatedByEmail· string · Optional — Email of the user who created the resourcecreatedById· string · Required · format: uuid — Id of the user who created the organizationcreatedByName· string · Required — Name of the user who created the organizationid· string · Required · format: uuid — The ID of the resourceisActive· boolean · Required — Is organization activename· string · Optional — The name of the resourceupdated· string · Optional · format: date-time — The time when the resource was last updated
spec· object · Required — SpecificationlegalEntityAddress· string or null · Optional — The legal address of the purchaser.legalEntityContactEmail· string or null · Optional — The primary officer's email address.legalEntityName· string or null · Optional — The legal entity name of the purchaser.legalEntityOfficer· string or null · Optional — The name of the primary officer of the purchaser.name· string · Optional — Name of the organization
Example:
{
"kind": "string",
"metadata": {
"created": "2024-01-01T00:00:00Z",
"createdBy": "00000000-0000-0000-0000-000000000000",
"createdByEmail": "string",
"createdById": "00000000-0000-0000-0000-000000000000",
"createdByName": "string",
"id": "00000000-0000-0000-0000-000000000000",
"isActive": true,
"name": "string",
"updated": "2024-01-01T00:00:00Z"
},
"spec": {
"legalEntityAddress": "string",
"legalEntityContactEmail": "string",
"legalEntityName": "string",
"legalEntityOfficer": "string",
"name": "string"
}
}
400 — Bad Request
error· object · Required — Pertinent information about the errorcode· string · Required — The error code.detail· string · Required — The error message.extraDetail· map from strings to any · Optional — Extra information regarding this error.[any key]· any — map of additional properties
ref· string · Required — A reference to the request that caused the error.status· integer · Required — The HTTP status code
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
401 — Unauthorized
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
403 — Forbidden
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
404 — Not Found
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
429 — Too Many Requests
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
500 — Internal Server Error
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
Source spec: management-api · operationId: [post]_/api/v1/organization