Authentication
MIDAPI v2 endpoints are authenticated with a consumer JWT token sent in the Authorization: Bearer <token> header. The token is issued based on the two concepts introduced in MIDAPI v2: the client platform issues tokens for its consumers, and each operational request is made on behalf of a consumer.
Identification headers
platform-id
Identifies the client platform. Required only when issuing a consumer token (POST /consumer/token).
platform-api-key
Client platform API key. Required only when issuing a consumer token (POST /consumer/token).
consumer-id
Identifies the channel/consumer. Required for all operational endpoints.
Operational endpoint requirements
All MIDAPI v2 operational endpoints require:
OAuth2 authentication: header
Authorization: Bearer <token>, obtained viaPOST /consumer/token(RS256-signed JWT, see below).Header
consumer-id: consumer identifier. Required and must not be empty.Header
operation-id: identifier of the operation to which the referenced assets belong, as returned byPOST /operation. Required for any endpoint whose request references stored assets, and always for Document Validation, which only accepts references.
Obtain a consumer token
Before calling any operational endpoint, the consumer must obtain a JWT token and send it in the header Authorization: Bearer <token>. The token is issued by Facephi and includes the consumer-id and the scopes corresponding to the services enabled for that consumer.
Endpoint
POST /consumer/tokenHeaders
platform-id
string
Yes
Client platform identifier.
platform-api-key
string
Yes
Client platform API Key.
Request body
Content-Type: application/json
Parameters
consumerId
string
Yes
Identifier of the consumer (channel or vertical) for which the token is requested.
Request example
Responses
200 Success
Response parameters
consumerId
string
Consumer for which the token was issued.
token
string
JWT Token to send in the header Authorization: Bearer <token>.
expiresAt
string
Token expiration date and time in ISO 8601.
Response example
Last updated