A Singapore Government Agency Website

GovEntry API (1.0.0)

Download OpenAPI specification:Download

API specification for GovEntry services

Authentication

All API endpoints require authentication using a JWT Bearer token. Include the token in the Authorization header:

Authorization: Bearer <your_token_here>

System

Health check endpoint

Simple endpoint to check if the API is accessible

Authorizations:
bearerAuth

Responses

Venues

Create or upsert venues

Create new venues or update existing ones.

Authorizations:
bearerAuth
Request Body schema: application/json
required
Array
id
string^[a-zA-Z0-9_@-]+$

Unique identifier for the venue.

string or null

Opening time of the venue. Must be before closes_at.

string or null

Closing time of the venue.

Array of objects (Metadata)

Additional metadata for the venue. Must be after opens_at.

Responses

Request samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Read venues

Retrieve details of venues.

Authorizations:
bearerAuth
query Parameters
id
string
Example: id=function-room-1

The ID of the venue to retrieve. If an id is provided, fetch details of a specific venue. Otherwise, fetch all venues.

Responses

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    }
]

Update a venue

Update details of an existing venue.

Authorizations:
bearerAuth
query Parameters
id
required
string
Example: id=function-room-1

The ID of the venue to update.

Request Body schema: application/json
required
string or null

Updated opening time of the venue. Must be before closes_at.

string or null

Updated closing time of the venue. Must be after opens_at.

Array of objects (Metadata)

Updated metadata for the venue.

Responses

Request samples

Content type
application/json
{
  • "opens_at": "2023-10-01T09:00:00+08:00",
  • "closes_at": "2023-10-01T17:00:00+08:00",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "id": "function-room-1",
  • "opens_at": "2023-10-01T09:00:00+08:00",
  • "closes_at": "2023-10-01T17:00:00+08:00",
  • "metadata": {
    },
  • "created_at": "2023-10-01T08:00:00+08:00",
  • "updated_at": "2023-10-01T10:00:00+08:00"
}

Delete a venue

Delete a specific venue by its ID.

Authorizations:
bearerAuth
query Parameters
id
required
string
Example: id=function-room-1

The ID of the venue to delete.

Responses

Response samples

Content type
application/json
{
  • "errors": {
    }
}

Attendees

Create or upsert attendees

Create new attendees or update existing ones.

Authorizations:
bearerAuth
Request Body schema: application/json
required
Array
id
string

Unique identifier for the attendee.

place_ids
Array of strings

List of place IDs the attendee is associated with.

Array of objects (Metadata)

Additional metadata for the attendee.

Responses

Request samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Read attendees

Retrieve details of attendees.

Authorizations:
bearerAuth
query Parameters
id
string
Example: id=ATTENDEE-123

The ID of the attendee to retrieve. If an id is provided, fetch details of a specific attendee. Otherwise, fetch all attendees.

Responses

Response samples

Content type
application/json
Example
[
  • {
    },
  • {
    }
]

Update an attendee

Update details of an existing attendee.

Authorizations:
bearerAuth
query Parameters
id
required
string
Example: id=ATTENDEE-123

The ID of the attendee to update.

Request Body schema: application/json
required
place_ids
Array of strings

Updated list of place IDs the attendee is associated with.

Array of objects (Metadata)

Updated metadata for the attendee.

Responses

Request samples

Content type
application/json
{
  • "place_ids": [
    ],
  • "metadata": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "ATTENDEE-123",
  • "place_ids": [
    ],
  • "metadata": {
    },
  • "created_at": "2023-10-01T08:00:00+08:00",
  • "updated_at": "2023-10-01T10:00:00+08:00"
}

Delete an attendee

Delete a specific attendee by its ID.

Authorizations:
bearerAuth
query Parameters
id
required
string
Example: id=ATTENDEE-123

The ID of the attendee to delete.

Responses

Response samples

Content type
application/json
{
  • "errors": {
    }
}

Files

Generate a presigned URL for file upload

Generates a presigned URL that allows temporary access to upload a file to S3. The URL has a limited validity period.

Usage Example

1. Request a presigned URL

GET https://{campaign_id}.app.entry.gov.sg/api/v1/files/presign-url?filename=profile.jpg
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

2. Use the presigned URL to upload a file

With the response from step 1, you can upload a file using the HTTP method specified in the response:

// Example using JavaScript fetch API
async function uploadFile(file) {
  // Step 1: Get the presigned URL
  const response = await fetch('https://campaign.app.entry.gov.sg/api/v1/files/presign-url?filename=' + file.name, {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
    }
  });
  
  const data = await response.json();
  
  // Step 2: Use the presigned URL to upload the file
  await fetch(data.presigned_url, {
    method: data.method,
    body: file,
    headers: {
      'Content-Type': file.type
    }
  });
  
  // Return the storage key for future reference
  return data.storage_key;
}
# Example using curl

# Step 1: Get the presigned URL
curl -X GET https://campaign.app.entry.gov.sg/api/v1/files/presign-url?filename=profile.jpg \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

# Step 2: Upload the file using the presigned URL
curl -X PUT PRESIGNED_URL_FROM_PREVIOUS_RESPONSE \
  -H "Content-Type: image/jpeg" \
  --data-binary /path/to/profile.jpg

For more information on using presigned URLs, see AWS Documentation: Uploading objects using presigned URLs

Authorizations:
bearerAuth
query Parameters
filename
required
string
Example: filename=profile.jpg

Name of the file to be uploaded

Responses

Chat with me!
Bot Launcher