# MOGU Public API

Public API for managing trips and catalogs in the MOGU platform

Version: 1.0.1
License: Proprietary

## Servers

Trips & Catalogs API
```
https://trips.api.moguplatform.com
```

AI API
```
https://ai.api.moguplatform.com
```

## Security

### bearerAuth

MOGU API Key (format starts with ak_) or Auth0 JWT token

Type: http
Scheme: bearer

### m2mOnBehalfOf

Auth0 M2M token (`client_credentials`) used for server-to-server integrations. Must be sent together with the `x-on-behalf-of` header to identify the agent the request acts on behalf of.
**Scope-based access.** Authorization is scope-based, not per-endpoint. Any authenticated operation documented in this specification accepts an M2M token whose JWT carries the same scopes the operation would require from a user-bound API key. For example, if your M2M client is granted `create:trips`, `update:trips` and `read:trips`, it can invoke every operation documented as requiring those scopes (not only the `POST /trips` example below).
The M2M client itself is authorized to operate on one or more accounts (its grant). The agent identified by `x-on-behalf-of` is the actor used for attribution and account resolution — it is not intersected with the agent's UI role. See the "M2M on-behalf-of" section in the documentation index for the full integration model.

Type: http
Scheme: bearer

## Download OpenAPI description

 - [MOGU Public API](https://api-docs.moguplatform.com/_bundle/openapi.yaml)

## ai

 - [POST /trip-imports](https://api-docs.moguplatform.com/openapi/ai/createtripfromdocument.md): Create a new trip from a document using AI. Supports URLs to documents (PDF, TXT, images) or plain text descriptions. The job runs asynchronously. Use the returned status URL to poll for completion. *
 - [GET /trip-imports/{publicId}/status](https://api-docs.moguplatform.com/openapi/ai/getjobstatus.md): Get the current status of a trip creation job. This endpoint is public and does not require authentication. **Status values:** - `processing`: Job is still running - `completed`: Trip has been created
 - [POST /trip-imports/{publicId}/actions/cancel](https://api-docs.moguplatform.com/openapi/ai/canceljob.md): Cancel a job that is still in progress. Only the agent who created the job can cancel it. Jobs can only be canceled while in `processing` status. Completed, errored, or already canceled jobs cannot be
## trips

 - [GET /trips](https://api-docs.moguplatform.com/openapi/trips/listtrips.md): Retrieve a paginated list of trips with optional filtering and sorting
 - [POST /trips](https://api-docs.moguplatform.com/openapi/trips/createtrip.md): Create a new trip with the specified details. Supports two authentication modes: a user-bound bearer token (default `bearerAuth`) or a server-to-server M2M token combined with the `x-on-behalf-of` hea
 - [POST /trips/bulk-delete](https://api-docs.moguplatform.com/openapi/trips/deletetripsinbulk.md): Delete multiple trips at once. Uses POST method for bulk operations.
 - [GET /trips/{tripId}](https://api-docs.moguplatform.com/openapi/trips/gettripbyid.md): Retrieve detailed information about a specific trip
 - [PATCH /trips/{tripId}](https://api-docs.moguplatform.com/openapi/trips/updatetrip.md): Update an existing trip's details
 - [DELETE /trips/{tripId}](https://api-docs.moguplatform.com/openapi/trips/deletetrip.md): Delete a specific trip by ID
 - [GET /trips/{tripId}/config](https://api-docs.moguplatform.com/openapi/trips/gettripconfig.md): Retrieve the complete configuration for a trip, including blocks, contact info, settings, and theme
 - [PUT /trips/{tripId}/config](https://api-docs.moguplatform.com/openapi/trips/updatetripconfig.md): Update the complete configuration for a trip (replaces existing config). When a service block brings a new or changed `googlePlaceId` (or a transport's `arrivalGooglePlaceId`) without coordinates, MOG
## catalogs

 - [GET /catalogs](https://api-docs.moguplatform.com/openapi/catalogs/listcatalogs.md): Retrieve a paginated list of catalogs
 - [POST /catalogs](https://api-docs.moguplatform.com/openapi/catalogs/createcatalog.md): Create a new catalog with the specified details
 - [DELETE /catalogs](https://api-docs.moguplatform.com/openapi/catalogs/deletecatalogsinbulk.md): Delete multiple catalogs at once.
 - [GET /catalogs/{id}](https://api-docs.moguplatform.com/openapi/catalogs/getcatalogbyid.md): Retrieve detailed information about a specific catalog
 - [PATCH /catalogs/{id}](https://api-docs.moguplatform.com/openapi/catalogs/updatecatalog.md): Update catalog details and associated trips
 - [DELETE /catalogs/{id}](https://api-docs.moguplatform.com/openapi/catalogs/deletecatalog.md): Delete a specific catalog by ID
 - [GET /catalogs/public/{slug}](https://api-docs.moguplatform.com/openapi/catalogs/getpubliccatalog.md): Retrieve a publicly accessible catalog by slug
## status

 - [GET /status](https://api-docs.moguplatform.com/openapi/status/getstatus.md): Check if the API is running
