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

# Create auth profile

` POST /v1/auth-profiles `

Create auth profile

## Servers

- ` https://screenframed.com ` — Production

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` bearerAuth `: ` http `

  - HTTP scheme: ` bearer `

  - ScreenFramed API key, such as `sf_live_...`.

## Request body (required)

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` domain `

  - ` name `: type ` string `

  - ` domain `: type ` string `

  - ` project_id `: type ` string `

    - pattern: ` "^prj_[A-Z0-9]{26}$" `

  - ` cookie_header `: type ` string `

  - ` storage_state `: type ` object `

    - ` cookies `: type ` array `

      - ` array item `: type ` object `

        - ` name `: type ` string `

        - ` value `: type ` string `

        - ` domain `: type ` string `

        - ` path `: type ` string `

        - ` expires `: type ` number `

        - ` httpOnly `: type ` boolean `

        - ` secure `: type ` boolean `

        - ` sameSite `: type ` string `

          - enum: ` ["Strict","Lax","None"] `

    - ` origins `: type ` array `

      - ` array item `: type ` object `

        - ` origin `: type ` string `; format ` uri `

        - ` localStorage `: type ` array `

          - ` array item `: type ` object `

            - ` name `: type ` string `

            - ` value `: type ` string `

  - ` cookies `: type ` array `

    - ` array item `: type ` object `

      - ` name `: type ` string `

      - ` value `: type ` string `

      - ` domain `: type ` string `

      - ` path `: type ` string `

      - ` expires `: type ` number `

      - ` httpOnly `: type ` boolean `

      - ` secure `: type ` boolean `

      - ` sameSite `: type ` string `

        - enum: ` ["Strict","Lax","None"] `

  - ` origins `: type ` array `

    - ` array item `: type ` object `

      - ` origin `: type ` string `; format ` uri `

      - ` localStorage `: type ` array `

        - ` array item `: type ` object `

          - ` name `: type ` string `

          - ` value `: type ` string `

## Responses

### ` 201 ` — Auth profile created

Content type: ` application/json `

- ` value `: type ` object `

  - ` profile `: type ` object `

    - ` id `: type ` string `

      - pattern: ` "^ap_" `

    - ` project_id `: type ` string `; nullable

    - ` name `: type ` string `

    - ` domain `: type ` string `

    - ` cookie_count `: type ` integer `

    - ` status `: type ` string `

    - ` last_used_at `: type ` string `; nullable

    - ` created_at `: type ` string `

    - ` updated_at `: type ` string `

### ` 400 ` — Error response

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` object `

    - Required fields: ` code `, ` message `

    - ` code `: type ` string `

    - ` message `: type ` string `

    - ` details `: type ` object `

    - ` retry_after `: type ` integer `

### ` 401 ` — Error response

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` object `

    - Required fields: ` code `, ` message `

    - ` code `: type ` string `

    - ` message `: type ` string `

    - ` details `: type ` object `

    - ` retry_after `: type ` integer `

### ` 403 ` — Error response

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` object `

    - Required fields: ` code `, ` message `

    - ` code `: type ` string `

    - ` message `: type ` string `

    - ` details `: type ` object `

    - ` retry_after `: type ` integer `

## Request examples

### cURL

```curl
curl -X POST 'https://screenframed.com/v1/auth-profiles' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "domain": "string",
  "project_id": "string",
  "cookie_header": "string",
  "storage_state": {
    "cookies": [
      {
        "name": "string",
        "value": "string",
        "domain": "string",
        "path": "string",
        "expires": 0,
        "httpOnly": true,
        "secure": true,
        "sameSite": "Strict"
      }
    ],
    "origins": [
      {
        "origin": "https://example.com",
        "localStorage": [
          {
            "name": "string",
            "value": "string"
          }
        ]
      }
    ]
  },
  "cookies": [
    {
      "name": "string",
      "value": "string",
      "domain": "string",
      "path": "string",
      "expires": 0,
      "httpOnly": true,
      "secure": true,
      "sameSite": "Strict"
    }
  ],
  "origins": [
    {
      "origin": "https://example.com",
      "localStorage": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    }
  ]
}'
```

### JavaScript

```javascript
const response = await fetch('https://screenframed.com/v1/auth-profiles', {
  method: 'POST',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "name": "string",
    "domain": "string",
    "project_id": "string",
    "cookie_header": "string",
    "storage_state": {
      "cookies": [
        {
          "name": "string",
          "value": "string",
          "domain": "string",
          "path": "string",
          "expires": 0,
          "httpOnly": true,
          "secure": true,
          "sameSite": "Strict"
        }
      ],
      "origins": [
        {
          "origin": "https://example.com",
          "localStorage": [
            {
              "name": "string",
              "value": "string"
            }
          ]
        }
      ]
    },
    "cookies": [
      {
        "name": "string",
        "value": "string",
        "domain": "string",
        "path": "string",
        "expires": 0,
        "httpOnly": true,
        "secure": true,
        "sameSite": "Strict"
      }
    ],
    "origins": [
      {
        "origin": "https://example.com",
        "localStorage": [
          {
            "name": "string",
            "value": "string"
          }
        ]
      }
    ]
  })
});

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

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.post('https://screenframed.com/v1/auth-profiles', headers=headers, json={
  "name": "string",
  "domain": "string",
  "project_id": "string",
  "cookie_header": "string",
  "storage_state": {
    "cookies": [
      {
        "name": "string",
        "value": "string",
        "domain": "string",
        "path": "string",
        "expires": 0,
        "httpOnly": true,
        "secure": true,
        "sameSite": "Strict"
      }
    ],
    "origins": [
      {
        "origin": "https://example.com",
        "localStorage": [
          {
            "name": "string",
            "value": "string"
          }
        ]
      }
    ]
  },
  "cookies": [
    {
      "name": "string",
      "value": "string",
      "domain": "string",
      "path": "string",
      "expires": 0,
      "httpOnly": true,
      "secure": true,
      "sameSite": "Strict"
    }
  ],
  "origins": [
    {
      "origin": "https://example.com",
      "localStorage": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    }
  ]
})
print(response.json())
```