Finish a native link
const url = 'http://127.0.0.1:8080/api/v1/auth/native-links';const options = { method: 'POST', headers: { Origin: 'example', 'X-CSRF-Token': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"code":"example","code_verifier":"example","redirect_uri":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
The PKCE verifier: 43 to 128 unreserved characters.
The return target used to begin the link.
Examplegenerated
{ "code": "example", "code_verifier": "example", "redirect_uri": "example"}Responses
Section titled “Responses”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.
object
object
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.
object
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}Structured authentication boundary failure
object
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}Structured authentication boundary failure
object
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.
object
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}Structured authentication boundary failure
object
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}Structured authentication boundary failure
object
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}