> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fincode.technology/llms.txt
> Use this file to discover all available pages before exploring further.

# Logout

> Invalidate the current user session by revoking the refresh token and access token.

Invalidate the current user session by revoking both the access token and the refresh token. After a successful logout, the user must perform a full login with email and password to regain access.

## Request Headers

<ParamField header="Content-Type" type="string" required default="application/json">
      Must be `application/json`
</ParamField>

<ParamField header="platform" type="string" required default="fincode">
      Platform identifier. Use `fincode`
</ParamField>

<ParamField header="uuid" type="string" required default="200">
      Unique request identifier. Use `200`
</ParamField>

<ParamField header="x-auth-token" type="string" required default="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJyb2xlcyI6WyJNQU5BR0VSIl0sInVzZXItaWQiOiJmMjBiYzg2Yy03NGU1LTQ1NzAtODdlNi0xNzUzZWQwZTM2OTYiLCJpc3MiOiJ0b2tlbi5pc3N1ZXI6aHR0cHM6Ly9tb25leXRyYW5zZmVyYXBwbGljYXRpb24uY29tIiwiZXhwIjoxNzYzNjU1NTAyLCJ0ZW5hbmN5LWlkIjoiMDEwODA3OWEtZTk2NS00OGNlLTkwOWMtZGU5MjliZDllODMwIiwiY2xpZW50LWlkIjoiMDEwODA3OWEtZTk2NS00OGNlLTkwOWMtZGU5MjliZDllODMwIiwiaWF0IjoxNzYzNjUxOTAyLCJqdGkiOiIyZWM1MmY2Yi05MGI1LTRlMGUtYWVm">
    Unique JWT token
</ParamField>

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const axios = require("axios");

  async function logout(refreshToken) {
    try {
      const response = await axios.put(
        "[https://remitjunction.fincode.software/api/v6/services/securitymanagement/logout](https://remitjunction.fincode.software/api/v6/services/securitymanagement/logout)",
        {
          refresh_token: refreshToken,
        },
        {
          headers: {
            "Content-Type": "application/json",
            platform: "fincode",
            uuid: "200",
          },
        }
      );

      console.log("Logout successful:", response.data.message);
      return response.data;
    } catch (error) {
      console.error("Logout failed:", error.response?.data || error.message);
      throw error;
    }
  }

  // Example Usage
  const currentRefreshToken = "eyJhbGciOiJ...";
  logout(currentRefreshToken);
  ```

  ```bash cURL theme={null}
  curl -X PUT "https://remitjunction.fincode.software/api/v6/services/securitymanagement/logout" \
    -H "Content-Type: application/json" \
    -H "platform: fincode" \
    -H "uuid: 200" \
    -d '{
      "refresh_token": "YOUR_CURRENT_REFRESH_TOKEN"
    }'
  ```
</CodeGroup>


## OpenAPI

````yaml PUT /securitymanagement/logout
openapi: 3.0.0
info:
  title: FinCode API
  version: v6
servers:
  - url: https://{tenant}.fincode.software/api/v6/services
    description: API v6
    variables:
      tenant:
        default: remitjunction
        description: Enter your tenant subdomain
  - url: https://{tenant}.fincode.software/api/v1/services
    description: API v1
    variables:
      tenant:
        default: finlend
        description: Enter your tenant subdomain
  - url: https://api.stag.songhaiexchange.io
    description: Songhai Exchange API
security: []
paths:
  /securitymanagement/logout:
    put:
      summary: Logout
      description: Invalidate user session
      operationId: logout
      parameters:
        - $ref: '#/components/parameters/platformHeader'
        - $ref: '#/components/parameters/uuidHeader'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                refresh_token:
                  type: string
      responses:
        '200':
          description: Logged out successfully
components:
  parameters:
    platformHeader:
      in: header
      name: platform
      schema:
        type: string
        default: fincode
      required: true
    uuidHeader:
      in: header
      name: uuid
      schema:
        type: string
        default: '200'
      required: true

````