Organisationen
Organisationen sind die obersten Entitäten in Capgo. Sie ermöglichen es Ihnen, Apps, Teammitglieder und Ressourcen unter einem einzigen Dach zu gruppieren. Jede Organisation kann mehrere Mitglieder mit unterschiedlichen Rollen und Berechtigungen haben.
Häufige Anwendungsfälle
Section titled “Häufige Anwendungsfälle”- Erstellen einer neuen Organisation für Ihr Unternehmen
- Verwalten von Organisationseinstellungen
- Aktualisieren von Organisationsinformationen
- Abrufen von Organisationsdetails
Endpunkte
Section titled “Endpunkte”https://api.capgo.app/organization/
Ruft Organisationsinformationen ab. Wenn orgId in den Parametern angegeben wird, wird eine einzelne Organisation zurückgegeben. Andernfalls werden alle zugänglichen Organisationen zurückgegeben.
Query-Parameter
Section titled “Query-Parameter”orgId(optional): Die ID der spezifischen Organisation, die abgerufen werden soll
Response-Typ
Section titled “Response-Typ”interface Organization { id: string created_by: string created_at: string updated_at: string logo: string | null name: string management_email: string customer_id: string | null}Beispiel-Anfrage
Section titled “Beispiel-Anfrage”# Alle Organisationen abrufencurl -H "authorization: your-api-key" https://api.capgo.app/organization/
# Spezifische Organisation abrufencurl -H "authorization: your-api-key" https://api.capgo.app/organization/?orgId=org_123Beispiel-Antwort
Section titled “Beispiel-Antwort”{ "data": { "id": "org_123", "name": "My Company", "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z", "logo": "https://example.com/logo.png", "management_email": "admin@example.com", "customer_id": "cus_123" }}https://api.capgo.app/organization/
Erstellt eine neue Organisation.
Request-Body
Section titled “Request-Body”interface OrganizationCreate { name: string}Beispiel-Anfrage
Section titled “Beispiel-Anfrage”curl -X POST \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "name": "New Organization" }' \ https://api.capgo.app/organization/Example Response
Section titled “Example Response”{ "status": "Organization created", "id": "org_456"}https://api.capgo.app/organization/
Update an existing organization. Requires admin role.
Request Body
Section titled “Request Body”interface OrganizationUpdate { orgId: string logo?: string name?: string management_email?: string}Example Request
Section titled “Example Request”curl -X PUT \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "orgId": "org_123", "name": "New Company Name", "management_email": "newemail@example.com" }' \ https://api.capgo.app/organization/Example Response
Section titled “Example Response”{ "status": "Organization updated", "data": { "id": "org_123", "name": "New Company Name", "management_email": "newemail@example.com" }}DELETE
Section titled “DELETE”https://api.capgo.app/organization/
Delete an existing organization. Requires admin role. This action is irreversible and will remove all associated apps, versions, and resources.
Query Parameters
Section titled “Query Parameters”orgId: The ID of the organization to delete
Example Request
Section titled “Example Request”curl -X DELETE \ -H "authorization: your-api-key" \ https://api.capgo.app/organization/?orgId=org_123Example Response
Section titled “Example Response”{ "status": "Organization deleted", "id": "org_123"}Error Handling
Section titled “Error Handling”Common error scenarios and their responses:
// Invalid API key{ "error": "Invalid API key", "status": "KO"}
// Missing required field{ "error": "Name is required", "status": "KO"}
// Insufficient permissions{ "error": "Admin role required", "status": "KO"}Best Practices
Section titled “Best Practices”- Naming: Use clear, descriptive names for organizations
- Roles: Assign appropriate roles to team members
- Email: Use a group email for management_email to avoid issues with personal email changes
- Logo: Host logos on a reliable CDN and use HTTPS URLs