---
title: "Update the specified auth secret"
method: PATCH
path: "/workspaces/{workspace_id}/secrets/{secret_id}"
tags: ["auth secrets"]
---

# Update the specified auth secret

`PATCH /workspaces/{workspace_id}/secrets/{secret_id}`

You need `workspaces.auth_secret.edit` permission to access this resource

## Path parameters

- `workspace_id` string, required
- `secret_id` string, required

## Request body

- object
  - `data` object, required
    - `id` string, required — Auth secret identifier. It has to match the identifier specified in the path.
    - `type` 'auth-secret', required — Allowed value `auth-secret`.
    - `attributes` object, required
      - `name` string, required — Name of the auth secret
      - `state` 'ready' | 'error', required — Auth secret state
      - `credentials` union, required
        - object
          - `access_token` string, required — Auth secret access token
          - `refresh_token` string — Auth secret refresh token
          - `expires_in` integer — Auth secret expired period. If not specified and `auth-client` is `oauth2` then the value will be taken from `token_expires_in` of linked `auth-client`. The value is set in seconds.
          - `additional_params` string — Auth secret additional parameters
          - `scope` string — Auth secret scope
          - `fields` object — If component has OAuthFieldView in component.json you can define additional fields in auth-secret for storing data
            - `base_url` string
        - object
      - `type` string
      - `error` string — Auth secret error

## Response `200`

OK

- object
  - `data` object, required
    - `id` string, required
    - `type` 'auth-secret', required — Allowed value: `auth-secret`
    - `links` object, required
      - `self` string, required
    - `attributes` object, required
      - `name` string, required — Name of the auth secret
      - `state` 'ready' | 'error', required — Auth secret state
      - `credentials` union, required
        - object
          - `access_token` string, required — Auth secret access token
          - `refresh_token` string — Auth secret refresh token
          - `expires_in` integer — Auth secret expired period. If not specified and `auth-client` is `oauth2` then the value will be taken from `token_expires_in` of linked `auth-client`. The value is set in seconds.
          - `additional_params` string — Auth secret additional parameters
          - `scope` string — Auth secret scope
          - `fields` object — If component has OAuthFieldView in component.json you can define additional fields in auth-secret for storing data
            - `base_url` string
        - object
      - `type` string
      - `error` string — Auth secret error
    - `relationships` object, required
      - `workspace` object, required
        - `data` object, required
          - `id` string, required
          - `type` 'workspace', required
        - `links` object, required
          - `self` string, required
      - `user` object, required
        - `data` object, required
          - `id` string, required
          - `type` 'user', required
        - `links` object, required
          - `self` string, required
      - `auth_client` object, required
        - `data` object, required
          - `id` string, required
          - `type` 'auth-client', required
        - `links` object, required
          - `self` string, required
  - `meta` object, required

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.net/elastic/apis/elastic-io-rest-api-documentation-v2.md) · [All operations](https://skmtc.net/elastic/apis/elastic-io-rest-api-documentation-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/elastic-io-rest-api-documentation-v2/revisions/411f9f98c01e/schema)
