# Refresh token POST https://api-sandbox.payabli.com/api/User/authrefresh Use this endpoint to refresh the authentication token for a user within an organization. Reference: https://docs.payabli.com/developers/api-reference/user/refresh-token-for-user ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Refresh token for User version: endpoint_user.AuthRefreshUser paths: /User/authrefresh: post: operationId: auth-refresh-user summary: Refresh token for User description: >- Use this endpoint to refresh the authentication token for a user within an organization. tags: - - subpackage_user parameters: - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_:PayabliApiResponseUserMfa' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} components: schemas: type_:IsSuccess: type: boolean type_:Responsedatanonobject: oneOf: - type: string - type: integer type_:ResponseText: type: string type_:PayabliApiResponseUserMfa: type: object properties: inactiveTokenTime: type: integer isSuccess: $ref: '#/components/schemas/type_:IsSuccess' remaining: type: integer responseData: $ref: '#/components/schemas/type_:Responsedatanonobject' responseText: $ref: '#/components/schemas/type_:ResponseText' required: - responseText ``` ## SDK Code Examples ```typescript import { PayabliClient, PayabliEnvironment } from "@payabli/sdk-node"; async function main() { const client = new PayabliClient({ environment: PayabliEnvironment.Sandbox, apiKey: "YOUR_API_KEY_HERE", }); await client.user.authRefreshUser(); } main(); ``` ```python from payabli import payabli from payabli.environment import payabliEnvironment client = payabli( environment=payabliEnvironment.SANDBOX, api_key="YOUR_API_KEY_HERE" ) client.user.auth_refresh_user() ``` ```csharp using PayabliApi; using System.Threading.Tasks; namespace Usage; public class Example { public async Task Do() { var client = new PayabliApiClient( apiKey: "YOUR_API_KEY_HERE", clientOptions: new ClientOptions { BaseUrl = PayabliApiEnvironment.Sandbox } ); await client.User.AuthRefreshUserAsync(); } } ``` ```go package example import ( client "github.com/payabli/sdk-go/v/client" option "github.com/payabli/sdk-go/v/option" payabli "github.com/payabli/sdk-go/v" context "context" ) func do() { client := client.NewClient( option.WithBaseURL( payabli.Environments.Sandbox, ), option.WithApiKey( "YOUR_API_KEY_HERE", ), ) client.User.AuthRefreshUser( context.TODO(), ) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/User/authrefresh") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/User/authrefresh") .header("requestToken", "") .asString(); ``` ```php request('POST', 'https://api-sandbox.payabli.com/api/User/authrefresh', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/User/authrefresh")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```