Test a custom API tool
POST/v1/agents/:agentId/custom-api-tools/:toolId/test
x-scope: "custom_api:write"
One real call to your site (two for a write when CSRF is switched on) with sample inputs, through the same path the AI's calls
take, without the AI. The answer is 200 whatever the site said: passed is the
outcome, and a passing test lets the tool be switched on. The site's response comes
back cut at 10,000 characters; the request sent is not echoed. By default Mojeeb waits up
to 15 seconds and refuses a response over 1 MB, as on the AI's calls. A test counts toward
your key's request budget, and your company can run 30 tests a minute across its keys
and the dashboard (429 test_rate_limited beyond that, with Retry-After).
Request
Responses
- 200
- 401
- 403
- 404
- 413
- 422
- 429
- 500
- 503
The test's outcome.
Response Headers
Correlation id for this request — paste into support tickets.
Authentication failed. Single code (invalid_api_key) covers every
sub-case: missing header, wrong scheme, malformed, unknown, revoked or
expired key. The message field disambiguates for humans debugging.
One exception: when the key could not be checked because of a server-side
fault, the status is still 401 but type is internal_error and code
is internal_server_error; retry with backoff.
Response Headers
Correlation id for this request — paste into support tickets.
Authenticated, but not allowed. insufficient_scope (the key lacks
custom_api:read or custom_api:write), agent_not_authorized (the
key is limited to other agents) or feature_not_available (Custom API
isn't on your company's plan).
Response Headers
Correlation id for this request — paste into support tickets.
agent_not_found when the agent is not one of your company's agents
(the API never confirms whether another company's agent exists);
not_found when the tool is not one of this agent's custom API tools;
endpoint_not_found for a path or method no endpoint serves, including
an id that is not a UUID.
Response Headers
Correlation id for this request — paste into support tickets.
The request body is larger than 1 MB.
Response Headers
Correlation id for this request — paste into support tickets.
invalid_request_body when the body isn't valid JSON, a field has the wrong type or
format, or a field breaks a limit in its schema; param names the field.
Response Headers
Correlation id for this request — paste into support tickets.
rate_limit_exceeded when the key used up its own request budget, or
test_rate_limited for the custom API test limit:
30 tests a minute per company, across its keys and the dashboard.
Either way Retry-After says when to try again; test_rate_limited
sends no X-RateLimit-* headers.
Response Headers
Correlation id for this request — paste into support tickets.
Seconds to wait before retrying.
The per-minute request limit of the endpoint called. Every key has the same limits today.
Remaining requests in the current window. 0 on rejection.
Unix timestamp at which the current window resets.
Unexpected server-side failure. Retry with exponential backoff. If
the failure persists, send us the correlation_id.
Response Headers
Correlation id for this request — paste into support tickets.
Mojeeb couldn't check access because of a temporary fault: the key's,
or on assignLead and assignConversation the teammate's. Nothing was
changed. Retry with backoff.
Response Headers
Correlation id for this request — paste into support tickets.