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

# Rotate auth key

> Immediately revokes the partner's current OAuth key and generates a brand-new 64-character secret key. All active sessions are invalidated, requiring the partner to re-authenticate with the new key.

### Headers

**x-api-version** `string` *required*

Target API version (e.g. `1.2`).

### Response Body

**success** `boolean`

Indicates whether key rotation succeeded (`true`).

**message** `string`

Informational notice: `OAuth key rotated successfully. Please log in again.`

**data.partnerId** `number`

Unique numeric identifier of the partner account.

**data.oauthKey** `string`

The newly generated 64-character hexadecimal OAuth key. Store this securely as prior keys are invalidated.

**data.rotatedAt** `string`

ISO 8601 UTC timestamp of key revocation and creation.

### Response Codes

| Code | Description |
| - | - |
| 200 | OAuth key rotated successfully. A new secret key is issued. |
| 401 | Unauthorized. Missing, expired, or invalid Bearer access token. |
| 500 | Internal Server Error. An unexpected error occurred on the server. |

```bash cURL theme={null}
curl -X POST https://qa-payments.mygigsters.com.au/api/v1/rotate-auth-key \
  -H "Content-Type: application/json" \
  -H "X-API-Version: 1.2" \
  -H "Authorization: Bearer <accessToken>"
```

```javascript Node.js theme={null}
const response = await fetch("https://qa-payments.mygigsters.com.au/api/v1/rotate-auth-key", {
  method: "POST",
  headers: {
    Authorization: "Bearer <accessToken>",
    "Content-Type": "application/json",
    "X-API-Version": "1.2",
  },
});

const data = await response.json();
console.log(data);
```

```python Python theme={null}
import requests

response = requests.post(
    "https://qa-payments.mygigsters.com.au/api/v1/rotate-auth-key",
    headers={
        "Authorization": "Bearer <accessToken>",
        "Content-Type": "application/json",
        "X-API-Version": "1.2",
    },
)

print(response.json())
```

```ruby Ruby theme={null}
require "net/http"
require "json"
require "uri"

uri = URI("https://qa-payments.mygigsters.com.au/api/v1/rotate-auth-key")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <accessToken>"
request["Content-Type"] = "application/json"
request["X-API-Version"] = "1.2"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts JSON.parse(response.body)
```

```php PHP theme={null}
<?php

$ch = curl_init("https://qa-payments.mygigsters.com.au/api/v1/rotate-auth-key");

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer <accessToken>",
        "Content-Type: application/json",
        "X-API-Version: 1.2",
    ],
]);

$response = curl_exec($ch);
curl_close($ch);

print_r(json_decode($response, true));
```

```java Java theme={null}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://qa-payments.mygigsters.com.au/api/v1/rotate-auth-key"))
            .header("Authorization", "Bearer <accessToken>")
            .header("Content-Type", "application/json")
            .header("X-API-Version", "1.2")
            .method("POST", HttpRequest.BodyPublishers.noBody())
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());

        System.out.println(response.body());
    }
}
```

```go Go theme={null}
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, err := http.NewRequest("POST", "https://qa-payments.mygigsters.com.au/api/v1/rotate-auth-key", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer <accessToken>")
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("X-API-Version", "1.2")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	data, _ := io.ReadAll(res.Body)
	fmt.Println(string(data))
}
```

```csharp .NET theme={null}
using System.Net.Http.Headers;
using System.Text;

using var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Post, "https://qa-payments.mygigsters.com.au/api/v1/rotate-auth-key");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "<accessToken>");
request.Headers.Add("X-API-Version", "1.2");

var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

```json Response theme={null}
{
  "success": true,
  "message": "OAuth key rotated successfully. Please log in again.",
  "data": {
    "partner_id": 4,
    "oauth_key": "471fdf7eeb7c46d70fbb915bc6d0ead58d449ceae128b0b336b935d745449f5a",
    "rotated_at": "2026-10-14T10:14:42.716Z"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.