---
title: "Access"
description: "A public service answers anyone with its URL; an authenticated one answers only EZGH API keys and Bot keys allowed to call it."
---

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

# Access

A service's `access` is `public` (the default) or `authenticated`. Changing it makes no revision and
takes effect at once.

## Public

Anyone with the URL can call the service. Your code does its own authentication.

## Authenticated

Each request must carry an EZGH [API key](/iam/api-keys) or a Bot key whose user or bot has
`run.services.invoke` on the service (in `RunFullAccess` and `RunInvokeAccess`):

```sh
curl -H "Authorization: Bearer $EZGH_API_KEY" https://api-k3f9a0.run.us-west-1.ezghapps.com/
```

- The key is checked on every request and removed before the request reaches your container. Your
  container gets the caller's ID in `X-Ezgh-Principal` (`usr_…` or `bot_…`).
- No key, or one that isn't an API key, is `401`. A key without `run.services.invoke` on the service,
  or from another organization, is `403`.
- Code in another service, a sandbox or an instance can call with its [bot](/iam/bots)'s
  short-lived key.

A `public` service answers faster, since nothing is checked per request.

Source: https://docs.ezghcloud.com/run/access/index.mdx
