Skip to main content
GET
/
v1
/
files
/
organization-files
Get organization files
curl --request GET \
  --url http://localhost:8787/v1/files/organization-files \
  --header 'x-api-key: <api-key>'
{
  "success": true,
  "org_id": "123e4567-e89b-12d3-a456-426614174000",
  "org_name": "Acme Corporation",
  "files": [
    {
      "id": "223e4567-e89b-12d3-a456-426614174001",
      "key": "org-id/document1.pdf",
      "url": "https://cdn.filejar.com/org-id/document1.pdf",
      "file_name": "document1.pdf",
      "content_type": "application/pdf",
      "size": 1024,
      "acknowledged_at": "2024-01-01T12:00:00Z",
      "created_at": "2024-01-01T11:00:00Z",
      "updated_at": "2024-01-01T12:00:00Z"
    },
    {
      "id": "323e4567-e89b-12d3-a456-426614174002",
      "key": "org-id/image1.jpg",
      "url": "https://cdn.filejar.com/org-id/image1.jpg",
      "file_name": "image1.jpg",
      "content_type": "image/jpeg",
      "size": 2048,
      "acknowledged_at": "2024-01-01T12:05:00Z",
      "created_at": "2024-01-01T12:00:00Z",
      "updated_at": "2024-01-01T12:05:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 100,
    "skip": 0,
    "total": 150,
    "total_pages": 2,
    "has_next": true,
    "has_previous": false
  },
  "count": 100
}

Authorizations

x-api-key
string
header
required

WorkOS API key for authentication

Query Parameters

page
integer
default:1

Page number (default: 1)

Required range: x >= 1
limit
integer
default:100

Items per page (default: 100, max: 1000)

Required range: 1 <= x <= 1000
skip
integer
default:0

Number of items to skip (default: 0). Takes precedence over page-based calculation.

Required range: x >= 0

Search in id, key, or file_name (case-insensitive partial match)

content_type
string

Filter by content type (exact match)

Example:

"image/png"

size__gte
integer

Filter by size greater than or equal (in bytes)

Required range: x >= 0
Example:

1024

size__lte
integer

Filter by size less than or equal (in bytes)

Required range: x >= 0
Example:

1048576

sort_by
enum<string>
default:created_at

Sort field (default: created_at)

Available options:
created_at,
updated_at,
file_name,
size,
content_type
sort
enum<string>
default:desc

Sort direction (default: desc)

Available options:
asc,
desc

Response

Files retrieved successfully

success
boolean
required

Indicates if the request was successful

Example:

true

org_id
string<uuid>
required

Database ID of the organization

Example:

"123e4567-e89b-12d3-a456-426614174000"

org_name
string
required

Name of the organization

Example:

"Acme Corporation"

files
object[]
required

Array of files belonging to the organization

pagination
object
required

Pagination metadata

count
integer
required

Number of files returned in this response

Example:

100