# Make a Hugging Face token the default

`PATCH /v1/integrations/{integration_id}/default`

Make a Hugging Face token the one new runs use. Workspaces on the old
default move to it.

Needs `integrations:write` and Contributor or above on the organization.

- Base URL: `https://junction-api.qualiastudios.dev`
- Authentication: an API key in the `X-API-Key` header, or `Authorization: Bearer …`

## Parameters

- `integration_id` (path, string (uuid), required)

## Responses

- `200` Successful Response: `application/json` `Integration`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `403` Missing integrations:write, or a Viewer's key: `application/json` `ErrorResponse`
- `404` Not found or access denied: `application/json` `ErrorResponse`
- `422` Not a Hugging Face token: `application/json` `ErrorResponse`

## Schemas

```yaml
Integration:
  properties:
    id:
      type: string
      format: uuid
      description: The integration key's ID
    provider:
      type: string
      const: huggingface
      description: The service the key is for
    name:
      type: string
      description: The key's name
    last4:
      description: The key's last four characters; null for a key shorter than 12
      type:
        - string
        - "null"
    is_default:
      type: boolean
      description: The Hugging Face token new runs use
    created_by:
      type: string
      format: uuid
      description: The person who added it
    created_at:
      type: string
      format: date-time
      description: When it was added
    expires_at:
      type: string
      format: date-time
      description: When it expires
  type: object
  required:
    - id
    - provider
    - name
    - is_default
    - created_by
    - created_at
    - expires_at
  title: Integration
  description: One integration key, without its value.
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
```
