---
title: "Generates an OAuth 1.0a header for authenticating requests to the X API."
method: POST
path: "/generateOAuthHeader"
---

# Generates an OAuth 1.0a header for authenticating requests to the X API.

`POST /generateOAuthHeader`

This function creates the Authorization header required for making authenticated requests to X. It takes the HTTP method, full URL, and optional additional parameters to generate a valid OAuth 1.0a header string.

## Request body

- object
  - `body` object — Body of the generateOAuthHeader sls call
    - `arguments` unknown[], required
      - unknown
    - `auth` object — Authentication object
      - `strategy` 'apikey' — Authentication strategy
      - `variables` unknown[] — Variables for the authentication strategy
        - unknown
    - `packageName` string — @microfox/twitter

## Response `200`

Successful response

- object
  - `oauthHeader` string — The generated OAuth 1.0a header

## Other responses

- `400` — Bad Request - Invalid input parameters
- `500` — Internal Server Error

## Changes

- **2025-05-29** `ec42d4a27567` — 3 breaking, 1 info
  - the response property `error` became optional for the status `400`
  - the response property `error` became optional for the status `500`
  - removed the required property `header` from the response with the `200` status
  - added the optional property `oauthHeader` to the response with the `200` status
- **2025-05-28** `9a6d6c9f0b84` — 1 warning, 3 info
  - removed the optional property `oauthHeader` from the response with the `200` status
  - the response property `error` became required for the status `400`
  - the response property `error` became required for the status `500`
  - added the required property `header` to the response with the `200` status

[Change history](https://skmtc.dev/microfox-ai/apis/microfox-x-sdk-api/changes/generateOAuthHeader/post.md)

---

[API](https://skmtc.dev/microfox-ai/apis/microfox-x-sdk-api.md) · [All operations](https://skmtc.dev/microfox-ai/apis/microfox-x-sdk-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/microfox-ai/microfox-x-sdk-api/revisions/329b4bca235b/schema)
