Skip to content

Finish a native link

POST
/api/v1/auth/native-links
curl --request POST \
--url http://127.0.0.1:8080/api/v1/auth/native-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Origin: example' \
--header 'X-CSRF-Token: example' \
--data '{ "code": "example", "code_verifier": "example", "redirect_uri": "example" }'

Available only when account authentication is enabled. Provider configuration is restart-bound. Local logout does not require an external provider. Responses must not be cached.

Origin
required
string
X-CSRF-Token
required
string
Media typeapplication/json
object
code
required

The one-time link code from the return target. It expires after one minute and is consumed by the first attempt with a valid session.

string
code_verifier
required

The PKCE verifier: 43 to 128 unreserved characters.

string
redirect_uri
required

The return target used to begin the link.

string
Examplegenerated
{
"code": "example",
"code_verifier": "example",
"redirect_uri": "example"
}

The provider identity is linked to the current account. Linking ends the account’s sessions, so the current session is replaced by a new one, returned in the instance’s session cookie.

Media typeapplication/json
object
csrf_token
required
string
invitation_accepted
required
boolean
user
required
object
display_name
required
string
id
required
string
instance_admin
required
boolean
key
additional properties
any
Examplegenerated
{
"csrf_token": "example",
"invitation_accepted": true,
"user": {
"display_name": "example",
"id": "example",
"instance_admin": true
}
}

invalid_grant: the code is unknown, expired, already used, issued to another session, or does not match the verifier. Nothing is linked and the current session remains.

Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
integer
title
required
string
type
required
string
Examplegenerated
{
"code": "example",
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

Structured authentication boundary failure

Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
integer
title
required
string
type
required
string
Examplegenerated
{
"code": "example",
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

Structured authentication boundary failure

Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
integer
title
required
string
type
required
string
Examplegenerated
{
"code": "example",
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

identity_conflict: the provider identity belongs to another account. Nothing is linked and the current session remains.

Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
integer
title
required
string
type
required
string
Examplegenerated
{
"code": "example",
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

Structured authentication boundary failure

Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
integer
title
required
string
type
required
string
Examplegenerated
{
"code": "example",
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

Structured authentication boundary failure

Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
integer
title
required
string
type
required
string
Examplegenerated
{
"code": "example",
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}