Remove a profile from a company
DELETE https://releva.ai/api/v0/roles/{companyId}/{emailOrPhone} removes the link between one profile and one company. The profile and the company are kept.
When to use it
Section titled “When to use it”Call it from your server when a person leaves a company in your system, or after you delete a company with Delete a company, which keeps its links.
Authentication
Section titled “Authentication”Send your shop’s Secret Key as a bearer token, from your server only:
authorization: Bearer $RELEVA_SECRET_KEYFind the key under Settings › Shop & Integration; see Find your Access Token and Secret Key. Authentication failures answer 400, not 401 (see Errors).
Request
Section titled “Request”DELETE /api/v0/roles/{companyId}/{emailOrPhone}. No body.
| Path part | Notes |
|---|---|
{companyId} |
The company’s id. |
{emailOrPhone} |
Read as an email address when it contains @, otherwise as a phone number. A phone number must be the stored international form; send its + as is or as %2B. |
curl -X DELETE 'https://releva.ai/api/v0/roles/DEMO-1001/maria@example.com' \ -H "authorization: Bearer $RELEVA_SECRET_KEY" \ -H 'content-type: application/json'By phone number:
curl -X DELETE 'https://releva.ai/api/v0/roles/DEMO-1001/%2B15555550199' \ -H "authorization: Bearer $RELEVA_SECRET_KEY" \ -H 'content-type: application/json'The older path DELETE /api/v0/companies/{companyId}/{emailOrPhone} does not exist and answers 404.
Response
Section titled “Response”202 Accepted with the body {}. The removal is queued and shows in the admin shortly after. If no profile matches, nothing changes and the response is still 202.
Errors
Section titled “Errors”Errors have one shape, { "message": "..." }.
| Status | When | Message |
|---|---|---|
400 |
No authorization header |
Authorization header is missing. |
400 |
The header is not Bearer <token> |
Authorization header is malformed. It should look like `Bearer <string>`. |
400 |
The token is not a UUID | Authorization header contains an invalid Bearer token. |
400 |
No shop has this key | Domain with the provided secret key cannot be found. |
402 |
The shop is disabled | Domain is disabled. Please reach out to support@releva.ai to enable it. |
500 |
Unexpected error | An internal error occurred. Retry later. |
Limits
Section titled “Limits”- One profile and one company per request.
- Rate limits: none on this endpoint.