Mojeeb AI Usage API
Your organization's plan and its message and agent usage, now and per billing period.
Your organization's plan and its message and agent usage, now and per billing period.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/mojeeb-app:mojeeb-app-usage-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Mojeeb App Usage API
version: 1.29.1
contact:
name: Mojeeb support
url: https://dashboard.mojeeb.app
description: 'Operations tagged Usage across 2 of this provider''s published API definitions: openapi.yaml, mojeeb-app-openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.mojeeb.app
description: Production
security:
- bearerAuth: []
- oauth2: []
tags:
- name: Usage
description: Your organization's plan and its message and agent usage, now and per billing period.
paths:
/v1/organization/usage:
get:
operationId: getUsage
x-scope: usage:read
tags:
- Usage
summary: Get your plan and current usage
description: 'Your organization''s plan, its subscription status and the billing period that covers
now, with the messages and agents used against the limits Mojeeb''s checks enforce.
Company-wide, whatever the key''s agent list, and read-only. It never returns prices or
payment details. When no single billing period covers now, the answer is `409`:
`no_current_usage_period` when none does (it clears when the renewal lands, and it is
also the answer with no subscription at all) or `usage_periods_overlap` when more than
one does.'
parameters:
- $ref: '#/components/parameters/CorrelationIdRequest'
responses:
'200':
description: The plan and the current period's usage.
headers:
X-Correlation-ID:
$ref: '#/components/headers/CorrelationIdResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/Usage'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/OrgForbidden'
'409':
$ref: '#/components/responses/UsagePeriodConflict'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/InternalError'
servers:
- url: https://api.mojeeb.app
description: Production
/v1/organization/usage/history:
get:
operationId: listUsageHistory
x-scope: usage:read
tags:
- Usage
summary: List usage by billing period
description: 'Every billing period of your organization''s current subscription, newest first, with the
messages used against each period''s limits; `current` marks the period that covers now.
The history starts again after a cancellation, when the free plan opens a new
subscription.'
parameters:
- $ref: '#/components/parameters/CorrelationIdRequest'
responses:
'200':
description: Every billing period of the current subscription.
headers:
X-Correlation-ID:
$ref: '#/components/headers/CorrelationIdResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/UsagePeriodList'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/OrgForbidden'
'404':
$ref: '#/components/responses/UsageHistoryNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/InternalError'
servers:
- url: https://api.mojeeb.app
description: Production
components:
responses:
Unauthorized:
description: '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.
'
headers:
X-Correlation-ID:
$ref: '#/components/headers/CorrelationIdResponse'
WWW-Authenticate:
schema:
type: string
example: Bearer realm="Mojeeb Public API"
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
error:
type: authentication_error
code: invalid_api_key
message: The API key is invalid, malformed, or revoked.
correlation_id: req_01KQER73VQBSZK5RPVZCPW221V
InternalError:
description: 'Unexpected server-side failure. Retry with exponential backoff. If
the failure persists, send us the `correlation_id`.
'
headers:
X-Correlation-ID:
$ref: '#/components/headers/CorrelationIdResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
error:
type: internal_error
code: internal_server_error
message: Something went wrong. Please try again.
correlation_id: req_01KQE...
UsageHistoryNotFound:
description: '`not_found` when your organization has no subscription, so no usage history.
'
headers:
X-Correlation-ID:
$ref: '#/components/headers/CorrelationIdResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
not_found:
value:
error:
type: not_found_error
code: not_found
message: No subscription found for your organization.
correlation_id: req_01KQE...
UsagePeriodConflict:
description: 'Mojeeb can''t name one current billing period for your organization, so
it can''t tell which limits apply. `no_current_usage_period`: no period
covers now, so Mojeeb treats the subscription as not renewed; it clears
when the renewal lands. `usage_periods_overlap`: more than one period
covers now. If either lasts, contact support with the `correlation_id`.
'
headers:
X-Correlation-ID:
$ref: '#/components/headers/CorrelationIdResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
no_current_usage_period:
value:
error:
type: conflict_error
code: no_current_usage_period
message: No billing period of your organization's subscription covers now, so Mojeeb treats it as not renewed. This clears when the renewal lands; if it lasts, contact support with this request's correlation_id.
correlation_id: req_01KQE...
usage_periods_overlap:
value:
error:
type: conflict_error
code: usage_periods_overlap
message: More than one billing period of your organization's subscription covers now, so Mojeeb can't tell which limits apply. Contact support with this request's correlation_id.
correlation_id: req_01KQE...
OrgForbidden:
description: '`insufficient_scope`: the key lacks the scope in this operation''s `x-scope`.
'
headers:
X-Correlation-ID:
$ref: '#/components/headers/CorrelationIdResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
insufficient_scope:
summary: A key without this operation's scope (here agents:read)
value:
error:
type: permission_error
code: insufficient_scope
message: This API key does not have the 'agents:read' scope.
required_scope: agents:read
correlation_id: req_01KQE...
RateLimited:
description: 'Per-key rate limit hit. Default is 60/min/key; an endpoint with an
`x-rate-limit-per-minute` of its own counts in a budget of its own
(today the WhatsApp template endpoints, `sendBroadcast`, `retryBroadcast`, `inviteMember`,
`resendInvitation`, `uploadAttachmentMedia`, `importAttachmentMedia`, `createUpload` and
`importSavedReplyMedia`, which share one that allows 10/min/key,
`sendConversationMessage`, which allows 20/min/key; `putUploadContent` takes no key and
allows the default 60/min per IP address), and its `429`
reports that limit in `X-RateLimit-Limit`. `Retry-After` tells you when to retry;
`X-RateLimit-Reset` is the Unix timestamp of the next window.
> Per-success-response `X-RateLimit-*` headers are a known gap; on
> 2xx responses these headers are NOT currently emitted. Customers
> should rely on 429 + `Retry-After` for backoff signals.
'
headers:
X-Correlation-ID:
$ref: '#/components/headers/CorrelationIdResponse'
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
rate_limit_exceeded:
value:
error:
type: rate_limit_error
code: rate_limit_exceeded
message: Too many requests. Try again in 60 seconds.
correlation_id: req_01KQE...
headers:
RateLimitLimit:
description: The per-minute request limit of the endpoint called. Every key has the same limits today.
schema:
type: integer
example: 60
RateLimitRemaining:
description: Remaining requests in the current window. `0` on rejection.
schema:
type: integer
example: 0
CorrelationIdResponse:
description: Correlation id for this request — paste into support tickets.
schema:
type: string
example: req_01KQEQT0FYHGVREWMR6669CX2K
RateLimitReset:
description: Unix timestamp at which the current window resets.
schema:
type: integer
example: 1730212354
RetryAfter:
description: Seconds to wait before retrying.
schema:
type: integer
example: 60
schemas:
UsagePeriod:
type: object
required:
- period
- messages
- agents
- current
properties:
period:
$ref: '#/components/schemas/BillingPeriod'
messages:
$ref: '#/components/schemas/MessageUsage'
agents:
type: object
required:
- limit
description: Agent usage isn't recorded per period; `getUsage` has today's count.
properties:
limit:
type: integer
description: The period's agent limit, add-ons included.
current:
type: boolean
description: Whether the period covers now. Two periods can both read true when they overlap; `getUsage` then answers `409 usage_periods_overlap`.
example:
period:
start: '2026-10-04T06:14:00Z'
end: '2026-11-04T06:14:00Z'
messages:
used: 4128
limit: 11000
remaining: 6872
percent: 37.5
agents:
limit: 3
current: true
UsagePeriodList:
type: object
required:
- items
properties:
items:
type: array
description: Newest first.
items:
$ref: '#/components/schemas/UsagePeriod'
MessageUsage:
type: object
required:
- used
- limit
- remaining
- percent
properties:
used:
type: integer
description: 'Messages counted in the period, in quota units: a reply from an agent with a large knowledge base counts as more than one, so `used` can pass `limit`.'
limit:
type: integer
description: The period's message allowance, add-ons included.
remaining:
type: integer
description: '`limit` minus `used`, never below zero.'
percent:
type: number
description: '`used` as a percentage of `limit`, rounded to one decimal. It can pass 100, and it is 0 when `limit` is 0.'
E164Phone:
type: string
pattern: ^\+[1-9]\d{6,14}$
example: '+15551234567'
description: 'E.164 international phone number — leading `+`, country code, then
7–15 digits. No spaces, dashes, or parens.
'
BillingPeriod:
type: object
required:
- start
- end
properties:
start:
type: string
format: date-time
description: When the period began.
end:
type: string
format: date-time
description: When it ends, which is when message usage starts again from zero.
Usage:
type: object
required:
- plan
- status
- period
- messages
- agents
description: Your organization's plan and its usage in the billing period that covers now. Never a price, a currency or payment details.
properties:
plan:
type: object
description: The plan your company is subscribed to.
required:
- code
- name
properties:
code:
type: string
description: 'The plan''s code as stored: `free_production`, `starter_production` or `professional_production` today. Older and custom plans have codes of their own, and new ones may appear.'
name:
type: string
description: The plan's name, in English.
status:
type: string
description: 'The subscription''s status: `active`, `trialing`, `past_due`, `paused`, `canceled` or `pending_payment`; new values may appear. `active` and `trialing` are in good standing.'
period:
$ref: '#/components/schemas/BillingPeriod'
messages:
$ref: '#/components/schemas/MessageUsage'
agents:
type: object
description: Your agents against the plan's limit.
required:
- used
- limit
properties:
used:
type: integer
description: 'Your organization''s agents now, deleted ones excluded: the number creating an agent is checked against.'
limit:
type: integer
description: How many agents the organization may have, add-ons included.
example:
plan:
code: professional_production
name: Professional
status: active
period:
start: '2026-10-04T06:14:00Z'
end: '2026-11-04T06:14:00Z'
messages:
used: 4128
limit: 11000
remaining: 6872
percent: 37.5
agents:
used: 2
limit: 3
ErrorEnvelope:
type: object
required:
- error
properties:
error:
type: object
required:
- type
- code
- message
- correlation_id
properties:
type:
type: string
description: 'Stable category for catch blocks: `authentication_error`,
`permission_error`, `validation_error`, `idempotency_error`,
`rate_limit_error`, `quota_error`, `conflict_error`,
`not_found_error` or `internal_error`. Forever-additive: new
types may appear, so keep a default branch.
'
code:
type: string
description: 'Stable, specific reason. **Branch on this**, not on `message`.
Forever-additive: new codes may appear without notice, so keep
your switch/match statements default-safe. Codes `/v1/` returns
today: `invalid_api_key`, `invalid_token`, `insufficient_scope`, `agent_not_authorized`, `agent_not_granted`, `shared_with_other_agents`, `feature_not_available`, `not_note_author`, `system_note_read_only`, `agent_not_found`, `not_found`, `lead_capture_not_found`, `ticket_capture_not_found`, `message_not_found`, `endpoint_not_found`, `invalid_request_body`, `invalid_request`, `invalid_date_range`, `no_settings`, `field_not_writable`, `unknown_timezone`, `invalid_ai_schedule`, `invalid_follow_up_platform`, `invalid_follow_up_steps`, `assignee_not_allowed`, `system_field`, `lead_field_limit_reached`, `ticket_field_limit_reached`, `connection_inactive`, `connection_needs_reconnection`, `field_key_taken`, `mobile_taken`, `too_many_leads`, `too_many_tickets`, `login_shared`, `tool_not_tested`, `comment_already_hidden`, `comment_not_hidden`, `platform_hide_failed`, `channel_not_supported`, `messaging_window_closed`, `no_current_usage_period`, `usage_periods_overlap`, `request_body_too_large`, `invalid_agent_id`, `invalid_phone_number`, `invalid_from_phone`, `from_phone_not_found_for_agent`, `recipient_required`, `recipient_conflict`, `recipient_not_found`, `auth_template_needs_phone`, `template_header_media_url_invalid`, `template_not_found`, `template_not_found_for_language`, `template_rejected`, `template_name_taken`, `template_limit_reached`, `template_status_not_allowed`, `template_edit_limit_reached`, `template_in_use_by_broadcast`, `template_reserved`, `template_delete_locks_name`, `template_not_approved`, `template_not_broadcastable`, `broadcast_still_sending`, `insufficient_role`, `owner_only`, `self_edit`, `self_remove`, `already_member`, `invitation_not_pending`, `unknown_agent`, `too_many_agents`, `attachment_type_locked`, `attachment_has_no_media`, `too_many_active_attachments`, `invalid_media`, `attachment_media_url_invalid`, `upload_not_found`, `upload_token_invalid`, `upload_already_written`, `upload_too_large`, `upload_size_mismatch`, `upload_type_not_allowed`, `upload_url_invalid`, `media_url_invalid`, `idempotency_key_in_progress`, `idempotency_key_in_use_with_different_params`, `idempotency_unknown_outcome`, `unknown_send_outcome`, `rate_limit_exceeded`, `test_rate_limited`, `video_send_rate_limited`, `message_limit_exceeded`, `test_chat_busy`, `meta_unavailable`, `media_processing_busy`, `access_unavailable`, `internal_server_error`. The errors guide explains each.
'
message:
type: string
description: 'Human-readable explanation. Wording may change without
notice — never use as a key.
'
correlation_id:
type: string
description: 'Request id for our logs. Always present. Save and quote
this when filing support tickets.
'
param:
type: string
description: 'Optional. The offending field''s name when the error is a
field-level validation failure.
'
required_scope:
type: string
description: 'Optional. Set on `insufficient_scope` errors — the scope
the request needed.
'
available_phones:
type: array
items:
$ref: '#/components/schemas/E164Phone'
description: 'Optional. Set on `from_phone_not_found_for_agent` —
the agent''s active WhatsApp numbers, in E.164.
'
available_templates:
type: array
items:
type: string
description: 'Optional. Set on `template_not_found`: the names of the connection''s templates, whatever their status (`listWhatsAppTemplates` shows each one''s status).'
available_languages:
type: array
items:
type: string
description: 'Optional. Set on `template_not_found_for_language`: the languages the template exists in, whatever their status.'
limit:
type: integer
description: 'Optional. Set on `message_limit_exceeded`: the plan''s message limit for the period.'
used:
type: integer
description: 'Optional. Set on `message_limit_exceeded`: messages used in the period.'
resets_at:
type: string
format: date-time
description: 'Optional. Set on `message_limit_exceeded`: when the period resets.'
original_correlation_id:
type: string
description: 'Optional. Set on `idempotency_key_in_use_with_different_params`
— points to the prior request that locked the key, so you
can find it in your own logs.
'
details:
type: object
description: 'Optional. Set on `mobile_taken`: the contact that already has the
number, as `contact_id` and `contact_name` (null when it has no
name). Left out when that contact can''t be named.
'
properties:
contact_id:
type: string
format: uuid
contact_name:
type:
- string
- 'null'
parameters:
CorrelationIdRequest:
name: X-Correlation-ID
in: header
required: false
description: 'Optional client-supplied trace id. If omitted we generate one. Up to
128 characters: letters, digits, `_` and `-`. An id that breaks these
rules is ignored without an error and we generate one instead, so read
the id back from the `X-Correlation-ID` response header. Echoed in
that header and in every error body.
'
schema:
type: string
maxLength: 128
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: mk_live_22-base62-chars_10-char-checksum
description: 'Server-to-server API key issued from the Mojeeb dashboard.
Treat like a database password — store in a secret manager,
never embed in client-side code.
'
oauth2:
type: oauth2
description: 'Sign in from an AI assistant (claude.ai, ChatGPT, Claude Code, Cursor) as a person. The
assistant acts with that person''s own access in Mojeeb, in the company they connected, until
the connection ends (the assistant signs out, or the person leaves the company). Public clients
with PKCE (S256); access tokens
last an hour and refresh tokens rotate on every use. Metadata:
`https://api.mojeeb.app/.well-known/oauth-authorization-server`.
'
flows:
authorizationCode:
authorizationUrl: https://api.mojeeb.app/oauth/authorize
tokenUrl: https://api.mojeeb.app/oauth/token
refreshUrl: https://api.mojeeb.app/oauth/token
scopes:
read: 'Read only: endpoints whose scope is a `…:read` scope.'
full: 'Read and change: every endpoint, with the person''s own access.'
x-refined-from:
- openapi.yaml
- mojeeb-app-openapi.yaml
x-provenance:
method: harvested
publisher: Mojeeb AI
source: https://api.mojeeb.app/v1/openapi.yaml
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)