API REFERENCE
Consents
Create a Consent
2 min
{ "name" "consents", "method" "post", "url" "https //api sandbox klavi ai/data/v1/consents", "description" "create a consent by linktoken", "tab" "examples", "examples" { "languages" \[ { "id" "2xgmrr1exjf8 8srjsvpr", "language" "curl", "code" "curl location 'https //api sandbox klavi ai/data/v1/consents' \\\\\n header 'accept application/json' \\\\\n header 'content type application/json' \\\\\n data '{\\"externaltrackid\\" \\"string\\",\\"personaltaxid\\" \\"string\\",\\"businesstaxid\\" \\"string\\",\\"institutioncode\\" \\"string\\",\\"redirecturl\\" \\"string\\",\\"phone\\" \\"string\\",\\"email\\" \\"string\\",\\"validityperiod\\" 12}'", "customlabel" "" } ], "selectedlanguageid" "2xgmrr1exjf8 8srjsvpr" }, "results" { "languages" \[ { "id" "senggbv6qgehwbvi zal6", "language" "200", "customlabel" "", "code" "{\n \\"consentid\\" \\"0325412e e566 4f4e ac5b 2f4471586b88\\",\n \\"consentredirecturl\\" \\"https //auth mockbank poc raidiam io/auth?client id= uwjusdgcwfqunokrjp0o\&scope=openid%20consent%3aurn%3araidiambank%3a76bfad6b\\",\n \\"expireat\\" \\"2024 11 21t23 59 59z\\"\n}" } ], "selectedlanguageid" "senggbv6qgehwbvi zal6" }, "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[ { "name" "authorization", "kind" "required", "type" "string", "description" "bearer link token, it returned by the /links", "children" \[] } ], "bodydataparameters" \[ { "name" "externaltrackid", "kind" "required", "type" "string", "description" "partners to transfer tracking information, each value must be unique" }, { "name" "personaltaxid", "kind" "required", "type" "string", "description" "the cpf of the end user, for personal accounts only(if end user is personal required)", "children" \[] }, { "name" "businesstaxid", "kind" "optional", "type" "string", "description" "the cnpj of the company, for business accounts only(if end user is business required)", "children" \[] }, { "name" "institutioncode", "kind" "required", "type" "string", "description" "institution code, it returned by the /institutions", "children" \[] }, { "name" "redirecturl", "kind" "required", "type" "string", "description" "the url for redirection upon successful link initialization", "children" \[] }, { "name" "phone", "kind" "optional", "type" "string", "description" "end user's phone, compliance needs", "children" \[] }, { "name" "email", "kind" "optional", "type" "string", "description" "end user's email, compliance needs", "children" \[] }, { "name" "clientmetadata", "kind" "optional", "type" "object", "description" "client metadata, recommended", "children" \[ { "name" "platform", "kind" "required", "type" "string", "description" "client type, enum \[ browser, app ]" }, { "name" "os", "kind" "required", "type" "string", "description" "os type, enum \[ linux, macos, unix, windows, ios, android, other ]" }, { "name" "osversion", "kind" "optional", "type" "string", "description" "os version, defaults to n/a" } ] }, { "name" "validityperiod", "kind" "required", "type" "number", "description" "the expiration month of the consent \nif validityperiod equals 0, the consent will have indefinite validity;\nif validityperiod equals 12, the consent form will only have a validity period of 12 months \nenum \[0, 12]", "" "the expiration month of the consent \nif validityperiod equals 0, the consent will have indefinite validity;\nif validityperiod equals 12, the consent form will only have a validity period of 12 months \nenum \[0, 12]" } ], "formdataparameters" \[] }, "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" }, "response" \[ { "name" "consentid", "kind" "optional", "type" "string", "description" "consent identify\nmaxlength 36" }, { "name" "consentredirecturl", "kind" "optional", "type" "string", "description" "consent redirect url, when the front end of the partner requests this url, the browser will redirect to the corresponding participant's authorization page, which will pop up the current link web page \nthis url can only be accessed once, and it has 60 seconds to be accessed \nif the user revokes their consent, or if their validity period has reached 60 minutes, the status will be transferred to rejected accessing this url will also return a failure ", "children" \[] }, { "name" "expireat", "kind" "optional", "type" "string", "description" "consent(specifically referring to the consensid) expire time(utc timezone)", "children" \[] } ] } parameter redirecturl the end user completes authorization and returns to the client's page url from the lgdp page if authorization succeeds, the klavi backend returns the redirecturl with the link id , consent id , external info and external track id parameters if authorization fails, the klavi backend returns the redirecturl with the link id , consent id , external info , external track id , error and error description parameters