# Edge Platform Admin API

Use the Edge Platform Admin API to create, retrieve, update, and delete custom hostnames in your organization.

 This REST API lets you interact with:

 - The custom hostname object. Use a [custom hostname](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/custom-hostnames.html) to serve content or direct traffic to specific web services or applications under your organization's domain.

After creating a custom hostname, you must:

 - [Register the hostname](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/set-up-a-custom-hostname.html#add-the-cname-and-txt-records-to-your-domains-dns-record). Add the CNAME and TXT records to verify domain ownership. 

 - [Check the status](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/set-up-a-custom-hostname.html#check-the-status-of-your-custom-hostname). Ensure that it is active before using the hostname. 

Note the following:

 - You must have an [*Organization Admin* or *Organization Owner* role](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/roles.html#organization-roles) in Sitecore Cloud Portal.

 - To use this REST API, you must authenticate your API requests.

 - All API requests are made in your production environment.

For more information, see the [official Sitecore Portal developer documentation](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/introduction-to-the-sitecore-cloud-portal.html).

## Authentication

The Edge Platform Admin API uses bearer authentication.

Bearer authentication involves security tokens called bearer tokens, which are generated in response to a login request.

To get the [bearer token](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/manage-api-tokens.html):

 1. Log in to [Sitecore Cloud Portal](https://portal.sitecorecloud.io/).

 2. In the top-right corner of the menu bar, click your profile ![profile](https://resources.doc.sitecore.com/assets/image/uuid-b9b63de7-4dd2-ed95-8901-29afe1d1bf30.PNG) > **API tokens**.

 3. Click **Copy to clipboard**.

You can now start making REST API requests. You must include this token in the authorization header of every request you make.

Version: 1.0
License: Apache 2.0

Metadata:
  - product: Cloud Portal

## Servers

Production server
```
https://edge-platform-admin-api.sitecorecloud.io
```

## Security

### BearerAuth

Type: http
Scheme: bearer
Bearer Format: JWT

## Download OpenAPI description

 - [Edge Platform Admin API](https://api-docs.sitecore.com/_bundle/portal/edge-platform-admin-rest-api/index.yaml)

## Organizations

 - [POST /api/admin/v1/hostnames](https://api-docs.sitecore.com/portal/edge-platform-admin-rest-api/organizations/post_em.md): Creates a custom hostname in your organization by specifying a `hostname`, a `defaultSiteId`, and a `defaultContextId`. Wildcards and apex domains are not currently supported for naming hostnames. The
 - [GET /api/admin/v1/hostnames](https://api-docs.sitecore.com/portal/edge-platform-admin-rest-api/organizations/get_sm.md): Retrieves the list of all custom hostnames in your organization. This lets you check if a certain hostname already exists. If the hostname exists and you need to retrieve, update, or delete it, you c
 - [GET /api/admin/v1/hostnames/{hostname}](https://api-docs.sitecore.com/portal/edge-platform-admin-rest-api/organizations/get_im.md): Retrieves a specific custom hostname in your organization, including details such as `defaultSiteId`, `defaultContextId`, and SSL certificate information. If you don't know the exact `hostname`, first
 - [PATCH /api/admin/v1/hostnames/{hostname}](https://api-docs.sitecore.com/portal/edge-platform-admin-rest-api/organizations/patch_am.md): Partially updates a custom hostname by replacing the `defaultSiteId`, `defaultContextId`, or both, as needed. The `hostname` itself cannot be updated after the custom hostname has been created and reg
 - [DELETE /api/admin/v1/hostnames/{hostname}](https://api-docs.sitecore.com/portal/edge-platform-admin-rest-api/organizations/delete_rm.md): Deletes a custom hostname and all its associated details. This is an irreversible operation.
