# REST Resource: projects.locations.namespaces

- [Resource: Namespace](https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces#Namespace)
  - [JSON representation](https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces#Namespace.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces#METHODS_SUMMARY)

## Resource: Namespace

A container for `https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces.services#Service`. Namespaces allow administrators to group services together and define permissions for a collection of services.

| JSON representation |
|---|
| ``` { "name": string, "labels": { string: string, ... }, "uid": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Immutable. The resource name for the namespace in the format `projects/*/locations/*/namespaces/*`. |
| `labels` | `map (key: string, value: string)` Optional. Resource labels associated with this namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `uid` | `string` Output only. The globally unique identifier of the namespace in the UUID4 format. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces/create` | Creates a namespace, and returns the new namespace. |
| ### `https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces/delete` | Deletes a namespace. |
| ### `https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces/get` | Gets a namespace. |
| ### `https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces/getIamPolicy` | Gets the IAM Policy for a resource (namespace or service only). |
| ### `https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces/list` | Lists all namespaces. |
| ### `https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces/patch` | Updates a namespace. |
| ### `https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces/setIamPolicy` | Sets the IAM Policy for a resource (namespace or service only). |
| ### `https://docs.cloud.google.com/service-directory/docs/reference/rest/v1/projects.locations.namespaces/testIamPermissions` | Tests IAM permissions for a resource (namespace or service only). |