Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API 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. See our Privacy Policy and
Terms.
openapi: 3.2.0
info:
title: Pricklymails Com Subscription API
version: 0.9.0
contact:
email: support@pricklymails.com
license:
name: Proprietary
description: 'Operations tagged subscription across 2 of this provider''s published API definitions: pricklymails-com-openapi.json, pricklymails-com-openapi.yaml. Each path carries the servers of the definition it was published in.'
tags:
- name: Subscription
description: The caller's subscription plan and status.
paths:
/api/subscription:
get:
tags:
- Subscription
summary: Returns the caller's active subscription
description: Accounts that never subscribed get HTTP 200 with a Free plan.
operationId: get_subscription
responses:
'200':
description: The caller's active subscription (a Free plan if never subscribed).
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionResponse'
'401':
description: Missing or invalid API key, session token, or agent token.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorBody'
'403':
description: The key or agent token lacks the `billing:read` scope.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorBody'
security:
- bearer_api_key: []
- jwt: []
components:
schemas:
ApiErrorDetail:
type: object
description: Detail of an error response.
required:
- code
properties:
code:
type: string
description: Stable key identifying the error (for example `"verify.invalid_uuid"`). Clients localize by this key.
message:
type:
- string
- 'null'
description: 'Present on most error kinds and equal to `code`; the API returns no localized text.
Absent for error kinds that carry no extra detail.'
SubscriptionResponse:
type: object
description: JSON response body for `GET /api/subscription`.
required:
- plan
- status
- billing_cycle
- period_start
- period_end
- monthly_credits
- has_access
properties:
billing_cycle:
type: string
description: Billing cycle (`"monthly"` or `"yearly"`).
external_id:
type:
- string
- 'null'
description: Identifier of the subscription at the payment provider, `null` when there is none.
has_access:
type: boolean
description: Whether the subscription provides access to the service.
monthly_credits:
type: integer
format: int32
description: Tokens granted each month by the plan.
minimum: 0
period_end:
type: string
format: date-time
description: End of the current billing period.
period_start:
type: string
format: date-time
description: Start of the current billing period.
plan:
type: string
description: 'Plan code: `"free"`, `"starter"`, `"pro"`, `"business"` or `"enterprise"`.'
status:
type: string
description: 'Subscription status: `"trial"`, `"active"`, `"past_due"`, `"canceled"`, `"expired"` or `"paused"`.'
trial_days_remaining:
type:
- integer
- 'null'
format: int64
description: Days remaining in a trial period. `null` when not in trial.
ApiErrorBody:
type: object
description: 'Error envelope returned with every non-success status: `{ "error": { "code", "message" } }`.'
required:
- error
properties:
error:
$ref: '#/components/schemas/ApiErrorDetail'
description: Error detail.
securitySchemes:
bearer_api_key:
type: http
scheme: bearer
description: A `pm_live_*` or `pm_test_*` API key.
jwt:
type: http
scheme: bearer
description: A short-lived token from `/api/auth/login`, or `/oauth/token` for an agent.
x-refined-from:
- pricklymails-com-openapi.json
- pricklymails-com-openapi.yaml