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

# Generate Cloud Uri

> Generate an authenticated URI for a cloud-hosted Morphik application.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml post /cloud/generate_uri
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /cloud/generate_uri:
    post:
      summary: Generate Cloud Uri
      description: Generate an authenticated URI for a cloud-hosted Morphik application.
      operationId: generate_cloud_uri_cloud_generate_uri_post
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - name: X-Morphik-Admin-Secret
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Morphik-Admin-Secret
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateUriRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
                title: Response Generate Cloud Uri Cloud Generate Uri Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Morphik from 'morphik';

            const client = new Morphik({
              apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.cloud.generateUri({ name: 'name' });

            console.log(response);
        - lang: cURL
          source: |-
            curl https://api.morphik.ai/cloud/generate_uri \
                -H 'Content-Type: application/json' \
                -H "Authorization: Bearer $MORPHIK_API_KEY" \
                -d '{
                      "name": "name"
                    }'
components:
  schemas:
    GenerateUriRequest:
      properties:
        app_id:
          anyOf:
            - type: string
            - type: 'null'
          title: App Id
          description: >-
            Optional client-generated app ID (UUID recommended). If omitted, the
            server generates one.
        name:
          type: string
          title: Name
          description: Name of the application
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: Optional owner user ID. If omitted, derived from the bearer token.
        expiry_days:
          type: integer
          title: Expiry Days
          description: 'Number of days until the token expires (default: 15 years)'
          default: 5475
        org_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Id
          description: Optional organization identifier for multi-tenant control planes
        created_by_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By User Id
          description: ID of the admin or service user that initiated the request
      type: object
      required:
        - name
      title: GenerateUriRequest
      description: Request model for generating a cloud URI
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````