For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inBook a demo
HomeGuidesAPI ReferenceGlossary
HomeGuidesAPI ReferenceGlossary
  • API Reference
      • GETGet All Groups
      • POSTCreate Group
      • GETGet Group
      • POSTUpdate Group
      • DELDelete Group
      • POSTGenerate JWT Token
      • POSTAdd Entities
      • POSTRemove Entities
        • GETSearch Group Users
        • POSTCreate Group User
        • GETGet Group User
        • POSTUpdate Group User
        • DELDelete Group User
        • POSTGenerate JWT Token
        • POSTSync Group Users
Logo
Sign inBook a demo
API ReferenceEntity GroupUser

Generate JWT Token

POST
https://api.mercoa.com/entityGroup/:entityGroupId/user/:foreignId/token
POST
/entityGroup/:entityGroupId/user/:foreignId/token
$curl -X POST https://api.mercoa.com/entityGroup/entg_a0f6ea94-0761-4a5e-a416-3c453cb7eced/user/MY-DB-ID-12345/token \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "expiresIn": "1h"
>}'
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 as the user in the Mercoa API and iFrame.
Was this page helpful?
Previous

Sync Group Users

Next
Built with

Authentication

AuthorizationBearer

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

Path parameters

entityGroupIdstringRequired
Entity Group ID or Entity Group ForeignID
foreignIdstringRequired
ID used to identify user in your system

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

400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
409
Conflict
500
Internal Server Error
501
Unimplemented