---
updatedAt: 2026-05-28T08:16:45.000Z
agentTools:
  projectIndex: https://docs.scalr.io/llms.txt
---

# Add remote state consumers

This endpoint adds provided workspaces
to a list of allowed remote state consumers for a given workspace.


# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "RemoteStateConsumerRelationship": {
        "description": "Represents remote state consumers' relationship.",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "enum": [
              "workspaces"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "type": "object"
      },
      "RemoteStateConsumerRelationshipFieldsetsListingDocument": {
        "description": "Document Listing.",
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/RemoteStateConsumerRelationship"
            },
            "type": "array"
          },
          "included": {
            "items": {
              "type": "object"
            },
            "readOnly": true,
            "type": "array"
          },
          "links": {
            "additionalProperties": {
              "type": "string"
            },
            "readOnly": true,
            "type": "object"
          },
          "meta": {
            "readOnly": true,
            "type": "object"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "API-Key": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Scalr IACP API",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "title": "Scalr IACP API",
    "version": "unversioned"
  },
  "openapi": "3.0.0",
  "paths": {
    "/workspaces/{workspace}/relationships/remote-state-consumers": {
      "post": {
        "description": "This endpoint adds provided workspaces\nto a list of allowed remote state consumers for a given workspace.\n",
        "operationId": "add_remote_state_consumers",
        "parameters": [
          {
            "description": "The ID of the workspace.\n",
            "in": "path",
            "name": "workspace",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "examples": {
                "default": {
                  "description": "The body must contain a `data` member whose value is an empty array or an array of workspace identifier objects.",
                  "value": "{\n\"data\": [\n    {\n      \"id\": \"ws-u2gp3vv58g0b9vo\",\n      \"type\": \"workspaces\"\n    },\n    {\n      \"id\": \"ws-u2gp3cuiq67fh18\",\n      \"type\": \"workspaces\"\n    }\n  ]\n}"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/RemoteStateConsumerRelationshipFieldsetsListingDocument"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success."
          },
          "403": {
            "description": "User unauthorized to perform this action."
          },
          "404": {
            "description": "Workspace not found, or user unauthorized to perform action."
          },
          "409": {
            "description": "Not allowed. `global-remote-state` is enabled for the workspace."
          },
          "4XX": {
            "description": "Client error."
          },
          "5XX": {
            "description": "Server error."
          }
        },
        "summary": "Add remote state consumers",
        "tags": [
          "remote-state-consumers"
        ],
        "x-resource": "Workspace",
        "x-service": "tf-api"
      }
    }
  },
  "security": [
    {
      "API-Key": []
    }
  ],
  "servers": [
    {
      "url": "https://{Domain}/api/iacp/v3",
      "variables": {
        "Domain": {
          "default": "example.scalr.io",
          "description": "Domain where Scalr is hosted"
        }
      }
    }
  ]
}
```

# Sibling pages

* [Delete remote state consumers](https://docs.scalr.io/scalr/reference/delete_remote_state_consumers.md)
* [List remote state consumers](https://docs.scalr.io/scalr/reference/list_remote_state_consumers.md)
* [Replace remote state consumers](https://docs.scalr.io/scalr/reference/replace_remote_state_consumers.md)