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

# Create a Deployment user with the APC API

<Note>
  The examples on this page show common ways to use the APC API — they're not a complete API reference. For the full, interactive API documentation for your installation, including every available query, mutation, and type, go to `https://houston.<your-base-domain>/v1`, and click on the **Docs** tab. See [Develop and test APC API queries](/docs/astro-private-cloud/v-2-x/houston-api-develop-test) for more on using the built-in GraphQL explorer.
</Note>

To add an existing Astro Private Cloud user to a Deployment, you need:

* Workspace Admin privileges
* A Deployment ID. To retrieve this value, run `astro deployment list` or request the `id` value in the `workspaceDeployment` query.
* The ID of the user to add. To retrieve this, request the `id` value in a `users` query or run `astro workspace user list`.
* The role to add the user as. Can be `DEPLOYMENT_ADMIN`, `DEPLOYMENT_EDITOR`, or `DEPLOYMENT_VIEWER`.

The following query adds a user to a Deployment as a Deployment viewer, then returns the user and Deployment information back to the requester.

```graphql wrap theme={null}
mutation AddDeploymentUser(
  $userId: Id! = "<user-id>",
  $email: String! = "usertoadd@mycompany.com",
  $deploymentId: Id! = "<some_id>",
  $role: Role! = DEPLOYMENT_VIEWER
)
{
		deploymentAddUserRole(
			userId: $userId
			email: $email
			deploymentId: $deploymentId
			role: $role
		) {
			id
			user {
				username
			}
			role
			deployment {
				id
				releaseName
			}
		}
	}
```
