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

# Create access key

> Creates an object storage IAM access key for a project. The secret is returned only once, in this response, and cannot be retrieved again. The provider is selected by `storage_class`: `standard` provisions the key on Wasabi and `high_performance` provisions it on VAST.



## OpenAPI

````yaml https://spec.speakeasy.com/latitude/latitude/latitude-sh-api-with-code-samples post /storage/access_keys
openapi: 3.0.1
info:
  title: Latitude.sh API
  version: '2023-06-01'
  description: >-
    The Latitude.sh API is a RESTful API to manage your Latitude.sh account. It
    allows you to perform the same actions as the Latitude.sh dashboard.
servers:
  - url: https://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
  - url: http://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
security: []
tags:
  - name: API keys
  - name: Billing
  - name: Elastic Ips
  - name: Events
  - name: Firewalls
  - name: IP Addresses
  - name: Kubernetes Clusters
  - name: Operating Systems
  - name: Plans
  - name: Private Networks
  - name: Projects
  - name: Regions
  - name: Roles
  - name: SSH Keys
  - name: Servers
  - name: Block Storage
  - name: Filesystem Storage
  - name: Object Storage
  - name: Tags
  - name: Teams
  - name: Team members
  - name: Traffic
  - name: User data
  - name: User profile
  - name: VPN Sessions
  - name: Virtual machines
  - name: Virtual machine backups
  - name: Virtual machine restores
paths:
  /storage/access_keys:
    post:
      tags:
        - Object Storage
      summary: Create access key
      description: >-
        Creates an object storage IAM access key for a project. The secret is
        returned only once, in this response, and cannot be retrieved again. The
        provider is selected by `storage_class`: `standard` provisions the key
        on Wasabi and `high_performance` provisions it on VAST.
      operationId: post-storage-access-keys
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: object
                  required:
                    - type
                    - attributes
                  properties:
                    type:
                      type: string
                      enum:
                        - access_keys
                    attributes:
                      type: object
                      required:
                        - project
                        - storage_class
                        - name
                        - access_scope
                        - region
                      properties:
                        project:
                          type: string
                          description: Project ID or slug the access key belongs to.
                        storage_class:
                          type: string
                          enum:
                            - standard
                            - high_performance
                          description: >-
                            Backend storage tier. `standard` provisions the key
                            on Wasabi; `high_performance` provisions it on VAST.
                          x-speakeasy-name-override: AccessKeyStorageClass
                        name:
                          type: string
                          description: >-
                            Name for the access key. Normalized server-side
                            (lowercased, with special characters replaced by
                            hyphens).
                        access_scope:
                          type: string
                          enum:
                            - fullaccess
                            - limited_access
                          description: >-
                            `fullaccess` grants access to all of the project's
                            buckets. `limited_access` restricts the key to the
                            buckets listed in `bucket_permissions`.
                        region:
                          type: string
                          description: >-
                            Region slug (e.g., `DAL`, `SAO2`). Selects the VAST
                            cluster for `high_performance` storage. Required for
                            all requests.
                        bucket_permissions:
                          type: array
                          description: >-
                            Per-bucket permissions. Required when `access_scope`
                            is `limited_access`; ignored for `fullaccess`.
                          items:
                            type: object
                            required:
                              - bucket_id
                              - permission
                            properties:
                              bucket_id:
                                type: string
                                description: Bucket (object storage) ID to grant access to.
                              permission:
                                type: string
                                enum:
                                  - readonly
                                  - rw
                                description: >-
                                  `readonly` grants read-only access; `rw`
                                  grants read and write access.
            examples:
              FullAccess:
                summary: Full access key (standard / Wasabi)
                value:
                  data:
                    type: access_keys
                    attributes:
                      project: proj_6059EqYkOQj8p
                      storage_class: standard
                      name: my-access-key
                      access_scope: fullaccess
                      region: DAL
              LimitedAccess:
                summary: Limited access key with per-bucket permissions
                value:
                  data:
                    type: access_keys
                    attributes:
                      project: proj_6059EqYkOQj8p
                      storage_class: standard
                      name: my-limited-key
                      access_scope: limited_access
                      region: DAL
                      bucket_permissions:
                        - bucket_id: bucket_6VE1Wd37dXnZJ
                          permission: readonly
                        - bucket_id: bucket_7WF2Xe48eYoAK
                          permission: rw
      responses:
        '201':
          description: Created
          content:
            application/vnd.api+json:
              examples:
                Created:
                  summary: Standard (Wasabi) access key
                  value:
                    data:
                      type: access_keys
                      attributes:
                        access_key:
                          access_key_id: AKIA123456789
                          secret_access_key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
                          name: my-access-key
                          status: Active
                          username: user+my-access-key@example.com
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - access_keys
                      attributes:
                        type: object
                        properties:
                          access_key:
                            type: object
                            description: >-
                              The newly created access key. The secret is
                              included only in this create response and cannot
                              be retrieved again. Field names depend on the
                              provider: `standard` (Wasabi) returns
                              `access_key_id` and `secret_access_key`;
                              `high_performance` (VAST) returns `access_key` and
                              `secret_key`.
                            properties:
                              access_key_id:
                                type: string
                                description: Access key ID (standard / Wasabi).
                              secret_access_key:
                                type: string
                                description: >-
                                  Secret access key (standard / Wasabi).
                                  Returned only once.
                              access_key:
                                type: string
                                description: Access key ID (high_performance / VAST).
                              secret_key:
                                type: string
                                description: >-
                                  Secret key (high_performance / VAST). Returned
                                  only once.
                              name:
                                type: string
                                description: Access key name.
                              status:
                                type: string
                                description: Access key status (e.g., `Active`).
                              username:
                                type: string
                                description: Underlying IAM user the key belongs to.
        '403':
          description: Forbidden
          content:
            application/vnd.api+json:
              examples:
                Unauthorized:
                  value:
                    errors:
                      - code: USER_AUTHORIZATION_ERROR
                        status: forbidden
                        title: User Authorization Error
                        detail: You are not authorized to perform this action.
                        meta: {}
              schema:
                $ref: '#/components/schemas/error_object'
        '404':
          description: Not Found
          content:
            application/vnd.api+json:
              examples:
                InvalidProject:
                  value:
                    errors:
                      - code: INVALID_PROJECT
                        title: Invalid project
                        detail: >-
                          We could not find the project you are trying to create
                          an access key for.
                        meta: {}
                        status: '404'
              schema:
                $ref: '#/components/schemas/error_object'
        '422':
          description: Unprocessable Entity
          content:
            application/vnd.api+json:
              examples:
                ValidationError:
                  value:
                    errors:
                      - code: VALIDATION_ERROR
                        title: Validation Error
                        detail: >-
                          bucket_permissions is required when access_scope is
                          limited_access
                        meta: {}
                        status: '422'
                InvalidRegion:
                  value:
                    errors:
                      - code: INVALID_REGION
                        title: Invalid region
                        detail: We could not find the region you specified.
                        meta: {}
                        status: '422'
                MissingWasabiStorage:
                  value:
                    errors:
                      - code: MISSING_WASABI_STORAGE
                        title: Missing Wasabi Storage
                        detail: >-
                          The project does not have a Wasabi object storage
                          configured.
                        meta: {}
                        status: '422'
                InvalidBucketId:
                  value:
                    errors:
                      - code: INVALID_BUCKET_ID
                        title: Invalid Bucket ID
                        detail: >-
                          One or more bucket IDs are invalid or do not belong to
                          this project.
                        meta: {}
                        status: '422'
              schema:
                $ref: '#/components/schemas/error_object'
      security:
        - Bearer: []
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tlatitudeshgosdk \"github.com/latitudesh/latitudesh-go-sdk\"\n\t\"github.com/latitudesh/latitudesh-go-sdk/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := latitudeshgosdk.New(\n        latitudeshgosdk.WithSecurity(os.Getenv(\"LATITUDESH_BEARER\")),\n    )\n\n    res, err := s.ObjectStorage.PostStorageAccessKeys(ctx, operations.PostStorageAccessKeysRequestBody{\n        Data: operations.PostStorageAccessKeysData{\n            Type: operations.PostStorageAccessKeysTypeAccessKeys,\n            Attributes: operations.PostStorageAccessKeysAttributes{\n                Project: \"proj_6059EqYkOQj8p\",\n                AccessKeyStorageClass: operations.AccessKeyStorageClassStandard,\n                Name: \"my-access-key\",\n                AccessScope: operations.AccessScopeFullaccess,\n                Region: \"DAL\",\n            },\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Object != nil {\n        // handle response\n    }\n}"
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Latitudesh } from "latitudesh-typescript-sdk";

            const latitudesh = new Latitudesh({
              bearer: process.env["LATITUDESH_BEARER"] ?? "",
            });

            async function run() {
              const result = await latitudesh.objectStorage.postStorageAccessKeys({
                data: {
                  type: "access_keys",
                  attributes: {
                    project: "proj_6059EqYkOQj8p",
                    accessKeyStorageClass: "standard",
                    name: "my-access-key",
                    accessScope: "fullaccess",
                    region: "DAL",
                  },
                },
              });

              console.log(result);
            }

            run();
components:
  schemas:
    error_object:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                nullable: true
              status:
                type: string
              title:
                type: string
              detail:
                type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
                  parameter:
                    type: string
              meta:
                type: object
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````