Skip to content

Start a connection from your server (pushed authorization request)

OpenAPI JSON
POST
/connect/par
curl --request POST \
--url https://api.eu.apigami.com/connect/par \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "redirect_uri": "https://example.com/apigami/callback", "code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM", "code_challenge_method": "S256", "state": "af0ifjsldkj", "login_hint": "jane@example.com" }'

RFC 9126. Opens the connection with your key, so no email travels in a URL, and returns the request_uri to put on https://app.apigami.com/connect?client_id={your app id}&request_uri={request_uri} within 90 seconds. Create it when the user clicks your connect button. login_hint prefills the email; for an app Apigami has allowed to vouch for its users’ emails, it also spares them the sign-in code. The user then has 30 minutes to finish, and comes back to redirect_uri with ?code&state, ?error=access_denied&state, or ?error=expired&state.

Media typeapplication/json
object
redirect_uri
required

One of your registered redirect URLs, scheme, host, port and path included. The query and the fragment may vary.

string format: uri
code_challenge
required

BASE64URL(SHA-256(code_verifier)), RFC 7636.

string
/^[A-Za-z0-9_-]{43}$/
code_challenge_method
required
Allowed value: S256
state

Returned unchanged on the redirect. Bind it to the user’s session.

string
<= 2048 characters
login_hint

Prefills the email on the connect page.

string format: email
Example
{
"redirect_uri": "https://example.com/apigami/callback",
"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"code_challenge_method": "S256",
"state": "af0ifjsldkj",
"login_hint": "jane@example.com"
}

The request is registered. Send the user to the connect page with it, within expires_in seconds.

Media typeapplication/json
object
request_uri
required
string
expires_in
required
integer
Allowed value: 90
Example
{
"request_uri": "urn:ietf:params:oauth:request_uri:0b5c7e1a-6f0d-4d0e-9a51-2b3c4d5e6f70",
"expires_in": 90
}

The request cannot open a connection.

Media typeapplication/json
object
error
required
string
consentPending

Present and true when the approval window is open and the user has not answered within 45 s.

boolean
Examples
{
"error": "redirect_uri is not registered for this app"
}

Missing, malformed or revoked API key.

Media typeapplication/json
object
error
required
string
consentPending

Present and true when the approval window is open and the user has not answered within 45 s.

boolean
Example
{
"error": "bad client credentials"
}