---
title: "Attach a Provider configuration to the workspace"
method: POST
path: "/workspaces/{workspace}/provider-configuration-links"
tags: ["provider-configuration-links"]
---

# Attach a Provider configuration to the workspace

`POST /workspaces/{workspace}/provider-configuration-links`

## Request

- Base URL: `https://example.scalr.io/api/iacp/v3`
- URL: `https://example.scalr.io/api/iacp/v3/workspaces/{workspace}/provider-configuration-links`
- Auth: HTTP bearer

Attach a Provider configuration to the workspace.

## Path parameters

- `workspace` string, required

## Request body

- ProviderConfigurationLinkDocument: JSON:API Document. see: https://jsonapi.org/format/#document-structure
  - `data` ProviderConfigurationLink: The provider configuration link attaches the provider configuration to an environment or workspace.
    - `attributes` object
      - `alias` string, nullable: Is used only for the workspace links. Meta-argument for using the same provider with different configurations for different resources.
      - `default` boolean: Is used only for the environment links. Indicates whether the provider configuration must be used in every environment workspace during runs without direct linking. This behaviour can be changed in specific workspace by creating direct workspace link without alias.
    - `id` string
    - `links` object
      - `self` string
    - `relationships` object, required
      - `environment` object
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'environments' | '', required
      - `provider-configuration` object, required
        - `data` object, required
          - `id` string, required
          - `type` 'provider-configurations' | '', required
      - `workspace` object
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'workspaces' | '', required
    - `type` 'provider-configuration-links', required
  - `included` object[]
  - `meta` object

## Response `201`

Created.

- ProviderConfigurationLinkDocument: JSON:API Document. see: https://jsonapi.org/format/#document-structure
  - `data` ProviderConfigurationLink: The provider configuration link attaches the provider configuration to an environment or workspace.
    - `attributes` object
      - `alias` string, nullable: Is used only for the workspace links. Meta-argument for using the same provider with different configurations for different resources.
      - `default` boolean: Is used only for the environment links. Indicates whether the provider configuration must be used in every environment workspace during runs without direct linking. This behaviour can be changed in specific workspace by creating direct workspace link without alias.
    - `id` string
    - `links` object
      - `self` string
    - `relationships` object, required
      - `environment` object
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'environments' | '', required
      - `provider-configuration` object, required
        - `data` object, required
          - `id` string, required
          - `type` 'provider-configurations' | '', required
      - `workspace` object
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'workspaces' | '', required
    - `type` 'provider-configuration-links', required
  - `included` object[]
  - `meta` object

## Other responses

- `403`: User unauthorized to perform action.
- `404`: Workspace or Provider configuration not found.
- `422`: Malformed request body (missing attributes, wrong types, etc.).
- `4XX`: Client error.
- `5XX`: Server error.

---

[API](https://skmtc.dev/scalr/apis/scalr-iacp-api.md) - [All operations](https://skmtc.dev/scalr/apis/scalr-iacp-api/llms.txt) - [OpenAPI document](https://skmtc.dev/scalr/apis/scalr-iacp-api/revisions/d3e1dc85657a?raw)
