Naming Your API Service

This page describes how to name your API service.

Google Cloud Endpoints uses DNS-compatible names to uniquely identify services, so your API service must have a globally unique name. Because Cloud Platform Console projects are guaranteed to have a globally unique name, you can always use your project name, for example my-cool-api.endpoints.my-project-id.cloud.goog, as your API service name.

If you don't want to use the endpoints.project-id.cloud.goog domain, you can alternatively use a custom domain that you are authorized to use.

To name your API service:

  1. Open your API project's OpenAPI specification (openapi.yaml) file and locate the line for host:.

  2. If you want to use the .endpoints.project-id.cloud.goog domain, which is available without further verification, name the service using this pattern:

    [API-NAME].endpoints.[PROJECT-ID].cloud.goog
    

    Replace the placeholder [PROJECT-ID] with your project ID. Replace the placeholder [API-NAME] with your API's name (e.g. bookstore, or books-apis, etc.)

  3. If you don't want to use an endpoints.project-id.cloud.goog domain for your API service, you can use your own domain as your service name, for example, myapi.mycompany.com:

    1. Verify ownership of the domain.

    2. Name your API with any subdomain name under the verified domain. For example, owners of domain api.example.com can create services with names api.example.com, catalog.api.example.com, books.catalog.api.example.com.

Send feedback about...

Cloud Endpoints with gRPC