---
title: "POST /ingress/login-grants"
method: POST
path: "/ingress/login-grants"
tags: ["Environments"]
---

# POST /ingress/login-grants

`POST /ingress/login-grants`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ingress/login-grants`
- Auth: HTTP bearer

## Request body

- CreateIngressLoginGrantRequest: The proxy's signed login request, as the `/ingress/login` page received it in its query string.
  - `host` string, required: The hostname, without a port.
  - `next` string, nullable: Path on the host to return to.
  - `owner_id` integer, required
  - `owner_kind` string, required: `environment` or `sandbox` (a sandbox preview host).
  - `port` integer, nullable: The port the visitor reached the host on, when the proxy's request carries one (it leaves out the scheme's default). Pass it through unchanged: it is part of the signature.
  - `scheme` string, required: `http` or `https`: how the visitor reached the host.
  - `sig` string, required
  - `ts` integer, required: Unix seconds the proxy signed the request at.

## Response `201`

Grant issued; send the browser to redirect_url

- IngressLoginGrantResponse
  - `expires_at` string, required: When the session this grant can start expires. ISO 8601, UTC.
  - `grant_id` integer, required
  - `redirect_url` string, required: Where the browser goes next: the host's exchange path with a short-lived grant. Contains a credential; do not store it.

## Other responses

- `400`: Malformed login request
- `401`: Unauthorized
- `403`: Not a browser session, a bad or expired signature, or insufficient permissions
- `404`: Environment or sandbox not found
- `409`: The environment or sandbox preview does not require a Temps login
- `500`: Internal server error

## Changes

- **2026-11-09** `12896146b193`: 6 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `404` status
  - …2 more
- **2026-10-28** `b8d51a990805`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ingress/login-grants/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
