Create a subscription
POST
/user/{userId}/subscription
const url = 'https://example.com/user/example/subscription';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"subscriptionStartDate":"2026-04-15T12:00:00Z","subscriptionEndDate":"2026-04-15T12:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/user/example/subscription \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "subscriptionStartDate": "2026-04-15T12:00:00Z", "subscriptionEndDate": "2026-04-15T12:00:00Z" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”userId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
subscriptionStartDate
string format: date-time
subscriptionEndDate
string format: date-time
Examplegenerated
{ "subscriptionStartDate": "2026-04-15T12:00:00Z", "subscriptionEndDate": "2026-04-15T12:00:00Z"}Responses
Section titled “Responses”Subscription created.
Media typeapplication/json
A period of access to the configured Abi service for a user.
object
subscriptionId
The unique identifier for the subscription.
string
userId
The Abi user identifier associated with the subscription.
string
active
Whether the subscription is active.
integer
startSubscription
The UTC date on which the subscription starts.
string
endSubscription
The UTC date on which the subscription expires.
string
createdAt
The date and time the subscription was created in Abi.
string
canceledAt
The date and time the subscription was cancelled
string
renewFrom
The previous expired subscription that caused this renewal
string
Example
{ "subscriptionId": "8910zyx321cba", "userId": "abi12345", "active": 0, "startSubscription": "2020-11-27", "endSubscription": "2020-12-29", "createdAt": "2020-11-27", "canceledAt": "2020-12-13", "renewFrom": "8910zyx123xxx"}