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

# Store ECR Container Registry credentials

> Stores AWS Elastic Container Registry credentials at organization level. The credentials will be encrypted and stored securely.



## OpenAPI

````yaml post /integrations/ecr/container-registry/organization/{organizationId}/credentials
openapi: 3.0.0
info:
  title: Cybedefend API
  description: >-
    CybeDefend is an advanced API for application security analysis. Key
    features include OAuth 2.0 authentication, user/organization/project
    management, and REBAC-based permissions. It excels in static, dynamic, and
    IaC security analyses (SAST, DAST, IaC, etc.).
  version: '1.0'
  contact: {}
servers:
  - url: https://api-eu.cybedefend.com
    description: EU
  - url: https://api-us.cybedefend.com
    description: US
security: []
tags: []
paths:
  /integrations/ecr/container-registry/organization/{organizationId}/credentials:
    post:
      tags:
        - ECR Container Registry
      summary: Store ECR Container Registry credentials
      description: >-
        Stores AWS Elastic Container Registry credentials at organization level.
        The credentials will be encrypted and stored securely.
      operationId: EcrContainerRegistryOrganizationController_storeCredentials
      parameters:
        - name: organizationId
          required: true
          in: path
          description: CybeDefend organization ID
          schema:
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
            type: string
      requestBody:
        required: true
        description: ECR credentials to store
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EcrStoreCredentialsDto'
      responses:
        '201':
          description: Credentials stored successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EcrCredentialResponseDto'
        '400':
          description: Invalid request body or credentials format
          content:
            application/json:
              schema:
                example:
                  message: Bad Request
                  statusCode: 400
                  timestamp: '2025-02-18T12:31:18.491Z'
                  path: /example/path
        '401':
          description: Unauthorized - Invalid or missing authentication token
          content:
            application/json:
              schema:
                example:
                  message: Unauthorized
                  statusCode: 401
                  timestamp: '2025-02-18T12:31:18.491Z'
                  path: /example/path
        '403':
          description: Forbidden - Insufficient permissions to manage integrations
          content:
            application/json:
              schema:
                example:
                  message: Forbidden
                  statusCode: 403
                  timestamp: '2025-02-18T12:31:18.491Z'
                  path: /example/path
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                example:
                  message: Internal server error
                  statusCode: 500
                  timestamp: '2025-02-18T12:31:18.491Z'
                  path: /example/path
components:
  schemas:
    EcrStoreCredentialsDto:
      type: object
      properties:
        name:
          type: string
          description: Display name for the credential
          example: ECR Prod
        credentialId:
          type: string
          description: Existing credential id to update (rotation/type switch)
        projectId:
          type: string
          description: 'Deprecated: credentials are org-level. Ignored.'
          example: 097bbbf4-d1eb-4512-9950-684445279808
        credentialType:
          type: string
          description: Authentication mode
          enum:
            - static_keys
            - iam_role
          default: static_keys
        awsAccountId:
          type: string
          description: AWS Account ID (12 digits) — required for static_keys mode
          example: '123456789012'
        awsRegion:
          type: string
          description: AWS Region
          example: us-east-1
        awsAccessKeyId:
          type: string
          description: AWS Access Key ID — required for static_keys mode
          example: AKIAIOSFODNN7EXAMPLE
        awsSecretAccessKey:
          type: string
          description: AWS Secret Access Key — required for static_keys mode
          example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
        roleArn:
          type: string
          description: >-
            IAM role ARN to assume — required for iam_role mode. e.g.
            arn:aws:iam::123456789012:role/cybedefend-ecr
          example: arn:aws:iam::123456789012:role/cybedefend-ecr
        externalId:
          type: string
          description: >-
            External ID enforced in the role trust policy (iam_role mode). Use
            the value returned by the prepare-iam-role endpoint.
        description:
          type: string
          description: Description for this credential
          example: Production ECR registry
      required:
        - name
        - awsRegion
    EcrCredentialResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Credential ID
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        awsAccountId:
          type: string
          description: AWS Account ID (12 digits)
          example: '123456789012'
        awsRegion:
          type: string
          description: AWS Region
          example: us-east-1
        awsAccessKeyId:
          type: string
          description: AWS Access Key ID (static_keys mode only)
          example: AKIAIOSFODNN7EXAMPLE
        credentialType:
          type: string
          description: Authentication mode
          enum:
            - static_keys
            - iam_role
        roleArn:
          type: string
          description: IAM role ARN (iam_role mode only)
          example: arn:aws:iam::123456789012:role/cybedefend-ecr
        description:
          type: string
          description: Description
          example: Production ECR registry
        createdAt:
          type: string
          description: Creation date
          example: '2025-01-01T00:00:00Z'
      required:
        - id
        - awsAccountId
        - awsRegion
        - createdAt

````