Quick Start

Generate Your First Design

curl -X POST "https://wepost-saga-api-dch2akd2b8e6bqdf.norwayeast-01.azurewebsites.net/design" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Create a professional social media post about our new product launch",
    "profileId": "your_profile_id",
    "colorPalette": "blue,white,gray",
    "platform": "facebook"
  }'

API Reference

Design Management

Generate a Design

Generate a new design based on content and optional color palette.

Endpoint: POST /design

Request Body:

{
  "content": "<A text describing the design, could be a description of the product, a blog post, a social media post, etc.>",
  "profileId": "cltctkuka0000z6u75l4ij9zj",
  "colorPalette": "blue,white,gray",
  "platform": "facebook"
}

Parameters:

  • content (required): Text describing the design - can be a product description, blog post, social media post, etc.

  • profileId (required): Your profile ID from the WePost system

  • colorPalette (optional): Comma-separated color values (e.g., "blue,white,gray")

  • platform (required): Target platform ("facebook", "instagram", "twitter", etc.)

Example Request:

curl -X POST "https://wepost-saga-api-dch2akd2b8e6bqdf.norwayeast-01.azurewebsites.net/design" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Exciting news! Our new eco-friendly water bottle is now available. Perfect for staying hydrated on the go.",
    "profileId": "cltctkuka0000z6u75l4ij9zj",
    "colorPalette": "green,white,blue",
    "platform": "facebook"
  }'

Success Response (200):

{
  "success": true,
  "images": [
    "https://example.com/design1.jpg",
    "https://example.com/design2.jpg"
  ],
  "pdf": "https://example.com/design.pdf",
  "postUrl": "https://example.com/post/123"
}

Error Response (400):

{
  "message": "Invalid request body",
  "errors": [
    {
      "code": "invalid_type",
      "expected": "string",
      "received": "undefined",
      "path": ["content"],
      "message": "Content is required"
    }
  ]
}

Schedule Management

Schedule a Design for Posting

Schedule a design to be posted at a specific date and time with an optional caption.

Endpoint: POST /schedule

Request Body:

{
  "profileId": "profile_123",
  "designId": "design_123",
  "scheduleDate": "2024-12-25T10:00:00.000Z",
  "platform": "facebook",
  "caption": "Check out our latest design!"
}

Parameters:

  • profileId (required): Your profile ID

  • designId (required): The ID of the design to schedule

  • scheduleDate (required): ISO 8601 date/time string for when to post

  • platform (required): Social media platform

  • caption (optional): Text caption for the post

Example Request:

curl -X POST "https://wepost-saga-api-dch2akd2b8e6bqdf.norwayeast-01.azurewebsites.net/schedule" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "profileId": "profile_123",
    "designId": "design_123",
    "scheduleDate": "2024-12-25T10:00:00.000Z",
    "platform": "facebook",
    "caption": "Check out our latest design!"
  }'

Success Response (200):

{
  "message": "Design scheduled successfully.",
  "scheduledPost": {}
}

Get a Scheduled Post

Retrieve details of a scheduled post by its ID.

Endpoint: GET /schedule/{postId}

Parameters:

  • postId (required): The ID of the scheduled post to retrieve

Example Request:

curl -X GET "https://wepost-saga-api-dch2akd2b8e6bqdf.norwayeast-01.azurewebsites.net/schedule/post_123" \
  -H "X-API-Key: YOUR_API_KEY"

Success Response (200):

{
  "postId": "post_123",
  "socialUrl": "https://www.facebook.com/1234567890",
  "scheduleDate": "2024-12-25T10:00:00.000Z",
  "caption": "Check out our latest design!",
  "platform": "facebook"
}

Cancel a Scheduled Design

Cancel a previously scheduled design post.

Endpoint: DELETE /schedule/{postId}

Parameters:

  • postId (required): The ID of the scheduled post to cancel

Example Request:

curl -X DELETE "https://wepost-saga-api-dch2akd2b8e6bqdf.norwayeast-01.azurewebsites.net/schedule/design_123" \
  -H "X-API-Key: YOUR_API_KEY"

Success Response (200):

{
  "message": "Scheduled design cancelled successfully."
}

Error Responses:

  • 400: Invalid design ID or request

  • 401: Unauthorized - Missing or invalid API key

  • 404: Scheduled design not found

Profile Management

Get All Profiles

Retrieve all profiles associated with your authenticated account.

Endpoint: GET /profiles

Example Request:

curl -X GET "https://wepost-saga-api-dch2akd2b8e6bqdf.norwayeast-01.azurewebsites.net/profiles" \
  -H "X-API-Key: YOUR_API_KEY"

Success Response (200):

{
  "message": "Profiles retrieved successfully",
  "data": [
    {
      "id": "1",
      "name": "John Doe"
    },
    {
      "id": "2",
      "name": "Company Brand"
    }
  ],
  "errors": []
}

Create a New Profile

Create a new user profile with the provided information.

Endpoint: POST /profiles

Request Body:

{
  "name": "John Doe"
}

Example Request:

curl -X POST "https://wepost-saga-api-dch2akd2b8e6bqdf.norwayeast-01.azurewebsites.net/profiles" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Marketing Team"
  }'

Success Response (201):

{
  "message": "Profile created successfully",
  "data": {
    "id": "3",
    "name": "Marketing Team"
  },
  "errors": []
}

Get a Profile by ID

Retrieve a specific profile by its ID.

Endpoint: GET /profiles/{id}

Parameters:

  • id (required): The unique identifier of the profile

Example Request:

curl -X GET "https://wepost-saga-api-dch2akd2b8e6bqdf.norwayeast-01.azurewebsites.net/profiles/1" \
  -H "X-API-Key: YOUR_API_KEY"

Update a Profile by ID

Update an existing profile's information.

Endpoint: PUT /profiles/{id}

Parameters:

  • id (required): The unique identifier of the profile

Request Body:

{
  "name": "Updated Profile Name"
}

Social Media Connections

Get Social Media Connection URL

Get the URL for connecting a social media account to a profile.

Endpoint: GET /social/{profileId}

Parameters:

  • profileId (required): The ID of the profile to connect social media to

Example Request:

curl -X GET "https://wepost-saga-api-dch2akd2b8e6bqdf.norwayeast-01.azurewebsites.net/social/profile_123" \
  -H "X-API-Key: YOUR_API_KEY"

Last updated