Logo
Sign inBook a demo
HomeGuidesAPI ReferenceGlossary
HomeGuidesAPI ReferenceGlossary
  • API Reference
Sign inBook a demo
API ReferenceEntity Group

Generate JWT Token

POST
https://api.mercoa.com/entityGroup/:entityGroupId/token
POST
/entityGroup/:entityGroupId/token
1curl -X POST https://api.mercoa.com/entityGroup/entg_a0f6ea94-0761-4a5e-a416-3c453cb7eced/token \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "expiresIn": "1h"
6}'
Try it
200Default
1"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTIzNDU2Nzg5LCJuYW1lIjoiSm9zZXBoIn0.OpOSSw7e485LOP5PrzScxHb7SR6sAOMRckfFwi4rp7o"
Generate a JWT token for an entity group with the given options. This token can be used to authenticate to any entity in the entity group in the Mercoa API and iFrame. <Warning>We recommend using [this endpoint](/api-reference/entity-group/user/get-token). This will enable features such as approvals and comments.</Warning>

Path parameters

entityGroupIdstringRequired
Entity Group ID or Entity Group ForeignID

Headers

AuthorizationstringRequired
Bearer authentication of the form `Bearer <token>`, where token is your auth token.

Request

This endpoint expects an object.
expiresInstringOptional
Expressed in seconds or a string describing a time span. The default is 1h.
invoiceobjectOptional
pagesobjectOptional
styleobjectOptional
vendorsobjectOptional
entityobjectOptional
sessionIdstringOptional
Optional session ID to use for the token. If not provided, this token will not be associated with a session.

Response

This endpoint returns a string.

Errors

Was this page helpful?
Previous

Add Entities

Next
Built with
Entity Group ID or Entity Group ForeignID

Bearer authentication of the form Bearer <token>, where token is your auth token.

Generate a JWT token for an entity group with the given options. This token can be used to authenticate to any entity in the entity group in the Mercoa API and iFrame.

We recommend using this endpoint. This will enable features such as approvals and comments.