---
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 using OAuth 1.0a. It takes the HTTP method, full URL, and optional additional parameters to generate a properly formatted and signed OAuth 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`

Successfully generated OAuth header

- object
  - `header` string, required — The generated OAuth 1.0a header

## Other responses

- `400` — Bad request - invalid input parameters
- `500` — Internal server error

## Changes

- **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/9a6d6c9f0b84/schema)
