---
updatedAt: 2026-05-26T21:25:49.000Z
agentTools:
  projectIndex: https://docs.socket.dev/llms.txt
---

# Get repository

Retrieve a repository associated with an organization.

This endpoint consumes 1 unit of your quota.

This endpoint requires the following org token scopes:
- repo:list

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "Specification of the Socket API endpoints",
    "title": "API Endpoints",
    "version": "0"
  },
  "servers": [
    {
      "url": "https://api.socket.dev/v0"
    }
  ],
  "tags": [
    {
      "name": "repos"
    }
  ],
  "components": {
    "responses": {
      "SocketBadRequest": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": true,
              "description": "",
              "properties": {
                "error": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "",
                      "default": ""
                    },
                    "details": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "",
                      "default": null,
                      "nullable": true
                    }
                  },
                  "required": [
                    "details",
                    "message"
                  ]
                }
              },
              "required": [
                "error"
              ]
            }
          }
        },
        "description": "Bad request"
      },
      "SocketUnauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": true,
              "description": "",
              "properties": {
                "error": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "",
                      "default": ""
                    },
                    "details": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "",
                      "default": null,
                      "nullable": true
                    }
                  },
                  "required": [
                    "details",
                    "message"
                  ]
                }
              },
              "required": [
                "error"
              ]
            }
          }
        },
        "description": "Unauthorized"
      },
      "SocketForbidden": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": true,
              "description": "",
              "properties": {
                "error": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "",
                      "default": ""
                    },
                    "details": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "",
                      "default": null,
                      "nullable": true
                    }
                  },
                  "required": [
                    "details",
                    "message"
                  ]
                }
              },
              "required": [
                "error"
              ]
            }
          }
        },
        "description": "Insufficient max_quota for API method"
      },
      "SocketTooManyRequestsResponse": {
        "description": "Insufficient quota for API route",
        "headers": {
          "Retry-After": {
            "description": "Retry contacting the endpoint *at least* after seconds.\nSee https://tools.ietf.org/html/rfc7231#section-7.1.3",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": true,
              "description": "",
              "properties": {
                "error": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "",
                      "default": ""
                    },
                    "details": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "",
                      "default": null,
                      "nullable": true
                    }
                  },
                  "required": [
                    "details",
                    "message"
                  ]
                }
              },
              "required": [
                "error"
              ]
            }
          }
        }
      },
      "SocketNotFoundResponse": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": true,
              "description": "",
              "properties": {
                "error": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "",
                      "default": ""
                    },
                    "details": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "",
                      "default": null,
                      "nullable": true
                    }
                  },
                  "required": [
                    "details",
                    "message"
                  ]
                }
              },
              "required": [
                "error"
              ]
            }
          }
        },
        "description": "Resource not found"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Organization Tokens can be passed as a Bearer token"
      },
      "basicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Organization Tokens can be passed as the user field in basic auth"
      }
    }
  },
  "paths": {
    "/orgs/{org_slug}/repos/{repo_slug}": {
      "get": {
        "tags": [
          "repos"
        ],
        "summary": "Get repository",
        "operationId": "getOrgRepo",
        "parameters": [
          {
            "name": "org_slug",
            "in": "path",
            "required": true,
            "description": "The slug of the organization",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo_slug",
            "in": "path",
            "required": true,
            "description": "The slug of the repository",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "branch",
            "in": "query",
            "required": false,
            "description": "An optional branch name to evaluate against the default branch and effective tracked branch patterns.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "description": "The workspace of the repository",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": [
              "repo:list"
            ]
          },
          {
            "basicAuth": [
              "repo:list"
            ]
          }
        ],
        "description": "Retrieve a repository associated with an organization.\n\nThis endpoint consumes 1 unit of your quota.\n\nThis endpoint requires the following org token scopes:\n- repo:list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The ID of the repository",
                      "default": ""
                    },
                    "created_at": {
                      "type": "string",
                      "description": "The creation date of the repository",
                      "default": ""
                    },
                    "updated_at": {
                      "type": "string",
                      "description": "The last update date of the repository",
                      "default": ""
                    },
                    "html_url": {
                      "type": "string",
                      "description": "The URL to the repository dashboard page",
                      "default": ""
                    },
                    "head_full_scan_id": {
                      "type": "string",
                      "description": "The ID of the head full scan of the repository",
                      "default": "",
                      "nullable": true
                    },
                    "integration_meta": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "github"
                              ]
                            },
                            "value": {
                              "type": "object",
                              "additionalProperties": true,
                              "description": "",
                              "properties": {
                                "installation_id": {
                                  "type": "string",
                                  "description": "The GitHub installation_id of the active associated Socket GitHub App",
                                  "default": ""
                                },
                                "installation_login": {
                                  "type": "string",
                                  "description": "The GitHub login name that the active Socket GitHub App installation is installed to",
                                  "default": ""
                                },
                                "repo_name": {
                                  "type": "string",
                                  "description": "The name of the associated GitHub repo.",
                                  "default": "",
                                  "nullable": true
                                },
                                "repo_id": {
                                  "type": "string",
                                  "description": "The id of the associated GitHub repo.",
                                  "default": "",
                                  "nullable": true
                                }
                              },
                              "required": [
                                "installation_id",
                                "installation_login",
                                "repo_id",
                                "repo_name"
                              ]
                            }
                          }
                        }
                      ],
                      "nullable": true
                    },
                    "slug": {
                      "type": "string",
                      "description": "The slug of the repository.",
                      "default": ""
                    },
                    "name": {
                      "type": "string",
                      "description": "The name of the repository",
                      "default": ""
                    },
                    "description": {
                      "type": "string",
                      "description": "The description of the repository",
                      "default": "",
                      "nullable": true
                    },
                    "homepage": {
                      "type": "string",
                      "description": "The homepage URL of the repository",
                      "default": "",
                      "nullable": true
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "private"
                      ],
                      "description": "The visibility of the repository",
                      "default": "private"
                    },
                    "archived": {
                      "type": "boolean",
                      "default": false,
                      "description": "Whether the repository is archived or not"
                    },
                    "default_branch": {
                      "type": "string",
                      "description": "The default branch of the repository",
                      "default": "main",
                      "nullable": true
                    },
                    "workspace": {
                      "type": "string",
                      "description": "The workspace of the repository",
                      "default": ""
                    },
                    "tracked_branch_patterns": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "pattern": {
                            "type": "string",
                            "description": "A branch glob matched case-insensitively, including dot characters.",
                            "default": ""
                          },
                          "description": {
                            "type": "string",
                            "description": "An optional description of the branch pattern.",
                            "default": ""
                          }
                        },
                        "required": [
                          "pattern"
                        ]
                      },
                      "description": "Read-only effective additional tracked branch patterns for this repository. Currently inherited from the organization; changes may take up to five minutes to propagate. Empty when no patterns are configured. The default_branch is always tracked separately."
                    },
                    "slig": {
                      "type": "string",
                      "description": "The slug of the repository. This typo is intentionally preserved for backwards compatibility reasons.",
                      "default": ""
                    },
                    "branch_tracking": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Null when no branch query parameter is supplied. Evaluated using the same effective patterns returned by this endpoint.",
                      "properties": {
                        "branch": {
                          "type": "string",
                          "description": "The branch name supplied in the branch query parameter.",
                          "default": ""
                        },
                        "is_tracked": {
                          "type": "boolean",
                          "default": false,
                          "description": "Whether the branch is the default branch or matches an effective tracked branch pattern."
                        },
                        "is_default": {
                          "type": "boolean",
                          "default": false,
                          "description": "Whether the branch exactly matches the repository default branch."
                        }
                      },
                      "required": [
                        "branch",
                        "is_default",
                        "is_tracked"
                      ],
                      "nullable": true
                    }
                  },
                  "required": [
                    "archived",
                    "branch_tracking",
                    "created_at",
                    "default_branch",
                    "description",
                    "head_full_scan_id",
                    "homepage",
                    "html_url",
                    "id",
                    "integration_meta",
                    "name",
                    "slig",
                    "slug",
                    "tracked_branch_patterns",
                    "updated_at",
                    "visibility",
                    "workspace"
                  ]
                }
              }
            },
            "description": "Lists repositories for the specified organization. The authenticated user must be a member of the organization."
          },
          "400": {
            "$ref": "#/components/responses/SocketBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/SocketUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/SocketForbidden"
          },
          "404": {
            "$ref": "#/components/responses/SocketNotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/SocketTooManyRequestsResponse"
          }
        },
        "x-readme": {}
      }
    }
  }
}
```