SkyPortal (0.9.dev0+git20200921.2724d5d)

Download OpenAPI specification:Download

SkyPortal provides an API to access most of its underlying functionality. To use it, you will need an API token. This can be generated via the web application from your profile page or, if you are an admin, you may use the system provisioned token stored inside of .tokens.yaml.

Accessing the SkyPortal API

Once you have a token, you may access SkyPortal programmatically as follows.

Python

import requests

token = 'ea70a5f0-b321-43c6-96a1-b2de225e0339'

def api(method, endpoint, data=None):
    headers = {'Authorization': f'token {token}'}
    response = requests.request(method, endpoint, json=data, headers=headers)
    return response

response = api('GET', 'http://localhost:5000/api/sysinfo')

print(f'HTTP code: {response.status_code}, {response.reason}')
if response.status_code in (200, 400):
    print(f'JSON response: {response.json()}')

Command line (curl)

curl -s -H 'Authorization: token ea70a5f0-b321-43c6-96a1-b2de225e0339' http://localhost:5000/api/sysinfo

Response

In the above examples, the SkyPortal server is located at http://localhost:5000. In case of success, the HTTP response is 200:

HTTP code: 200, OK
JSON response: {'status': 'success', 'data': {}, 'version': '0.9.dev0+git20200819.84c453a'}

On failure, it is 400; the JSON response has status="error" with the reason for the failure given in message:

{
  "status": "error",
  "message": "Invalid API endpoint",
  "data": {},
  "version": "0.9.1"
}

Authentication

token

Header should be in the format 'token abcd-efgh-0000-1234'

Security Scheme Type API Key
Header parameter name: Authorization

Retrieve an allocation

Retrieve an allocation

path Parameters
allocation_id
required
integer

Responses

200
400
get/api/allocation/allocation_id
/api/allocation/allocation_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update an allocation on a robotic instrument

Update an allocation on a robotic instrument

path Parameters
allocation_id
required
integer
Request Body schema: application/json
pi
string Nullable

The PI of the allocation's proposal.

proposal_id
string Nullable

The ID of the proposal associated with this allocation.

start_date
string <date-time> Nullable

The UTC start date of the allocation.

end_date
string <date-time> Nullable

The UTC end date of the allocation.

hours_allocated
required
number <float>

The number of hours allocated.

group_id
required
integer <int32>

The ID of the Group the allocation is associated with.

instrument_id
required
integer <int32>

The ID of the Instrument the allocation is associated with.

Responses

200
400
put/api/allocation/allocation_id
/api/allocation/allocation_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "pi": "string",
  • "proposal_id": "string",
  • "start_date": "2020-09-22T02:09:25Z",
  • "end_date": "2020-09-22T02:09:25Z",
  • "hours_allocated": 0,
  • "group_id": 0,
  • "instrument_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete allocation.

Delete allocation.

path Parameters
allocation_id
required
string

Responses

200
delete/api/allocation/allocation_id
/api/allocation/allocation_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all allocations

Retrieve all allocations

query Parameters
instrument_id
number

Instrument ID to retrieve allocations for

Responses

200
400
get/api/allocation
/api/allocation

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    [
    ],
  • "message": "string"
}

Post new allocation on a robotic instrument

Post new allocation on a robotic instrument

Request Body schema: application/json
pi
string Nullable

The PI of the allocation's proposal.

proposal_id
string Nullable

The ID of the proposal associated with this allocation.

start_date
string <date-time> Nullable

The UTC start date of the allocation.

end_date
string <date-time> Nullable

The UTC end date of the allocation.

hours_allocated
required
number <float>

The number of hours allocated.

group_id
required
integer <int32>

The ID of the Group the allocation is associated with.

instrument_id
required
integer <int32>

The ID of the Instrument the allocation is associated with.

Responses

200
post/api/allocation
/api/allocation

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "pi": "string",
  • "proposal_id": "string",
  • "start_date": "2020-09-22T02:09:25Z",
  • "end_date": "2020-09-22T02:09:25Z",
  • "hours_allocated": 0,
  • "group_id": 0,
  • "instrument_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve an observing run assignment

Retrieve an observing run assignment

path Parameters
assignment_id
required
integer

Responses

200
400
get/api/assignment/assignment_id
/api/assignment/assignment_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update an assignment

Update an assignment

path Parameters
assignment_id
required
integer
Request Body schema: application/json
requester_id
required
integer <int32>

The ID of the User who created this assignment.

last_modified_by_id
integer <int32> Nullable
obj_id
required
string

ID of the assigned Obj.

comment
string Nullable

A comment on the assignment. Typically a justification for the request, or instructions for taking the data.

status
string

Status of the assignment [done, not done, pending].

priority
required
string <= 1 characters
Enum: "1" "2" "3" "4" "5"

Priority of the request (1 = lowest, 5 = highest).

run_id
required
integer <int32>

ID of the ObservingRun this target was assigned to.

Responses

200
400
put/api/assignment/assignment_id
/api/assignment/assignment_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "requester_id": 0,
  • "last_modified_by_id": 0,
  • "obj_id": "string",
  • "comment": "string",
  • "status": "string",
  • "priority": "1",
  • "run_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete assignment.

Delete assignment.

path Parameters
assignment_id
required
string

Responses

200
delete/api/assignment/assignment_id
/api/assignment/assignment_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all observing run assignments

Retrieve all observing run assignments

Responses

200
400
get/api/assignment
/api/assignment

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    [
    ],
  • "message": "string"
}

Post new target assignment to observing run

Post new target assignment to observing run

Request Body schema: application/json
priority
required
any
Enum: "1" "2" "3" "4" "5"

Priority of the request, (lowest = 1, highest = 5).

run_id
required
integer <int32>
obj_id
required
string

The ID of the object to observe.

status
string

The status of the request

comment
string

An optional comment describing the request.

Responses

200
post/api/assignment
/api/assignment

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "priority": "1",
  • "run_id": 0,
  • "obj_id": "string",
  • "status": "string",
  • "comment": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a candidate

Retrieve a candidate

path Parameters
obj_id
required
string

Responses

200
400
get/api/candidates/obj_id
/api/candidates/obj_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update a candidate

Update a candidate

path Parameters
obj_id
required
string
Request Body schema: application/json
ra
number <float> Nullable
dec
number <float> Nullable
ra_dis
number <float> Nullable

J2000 Right Ascension at discovery time [deg].

dec_dis
number <float> Nullable

J2000 Declination at discovery time [deg].

ra_err
number <float> Nullable

Error on J2000 Right Ascension at discovery time [deg].

dec_err
number <float> Nullable

Error on J2000 Declination at discovery time [deg].

offset
number <float> Nullable

Offset from nearest static object [arcsec].

redshift
number <float> Nullable

Redshift.

altdata
any Nullable

Misc. alternative metadata stored in JSON format, e.g. {'gaia': {'info': {'Teff': 5780}}}

dist_nearest_source
number <float> Nullable

Distance to the nearest Obj [arcsec].

mag_nearest_source
number <float> Nullable

Magnitude of the nearest Obj [AB].

e_mag_nearest_source
number <float> Nullable

Error on magnitude of the nearest Obj [mag].

transient
boolean Nullable

Boolean indicating whether the object is an astrophysical transient.

varstar
boolean Nullable

Boolean indicating whether the object is a variable star.

is_roid
boolean Nullable

Boolean indicating whether the object is a moving object.

score
number <float> Nullable

Machine learning score.

origin
string Nullable

Origin of the object.

internal_key
string

Internal key used for secure websocket messaging.

detect_photometry_count
integer <int32> Nullable

How many times the object was detected above :math:S/N = 5.

Responses

200
400
patch/api/candidates/obj_id
/api/candidates/obj_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ra": 0,
  • "dec": 0,
  • "ra_dis": 0,
  • "dec_dis": 0,
  • "ra_err": 0,
  • "dec_err": 0,
  • "offset": 0,
  • "redshift": 0,
  • "altdata": null,
  • "dist_nearest_source": 0,
  • "mag_nearest_source": 0,
  • "e_mag_nearest_source": 0,
  • "transient": true,
  • "varstar": true,
  • "is_roid": true,
  • "score": 0,
  • "origin": "string",
  • "internal_key": "string",
  • "detect_photometry_count": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all candidates

Retrieve all candidates

query Parameters
numPerPage
integer

Number of candidates to return per paginated request. Defaults to 25

pageNumber
integer

Page number for paginated query results. Defaults to 1

totalMatches
integer

Used only in the case of paginating query results - if provided, this allows for avoiding a potentially expensive query.count() call.

unsavedOnly
boolean

Boolean indicating whether to return only unsaved candidates

startDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, filter by last_detected >= startDate

endDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, filter by last_detected <= endDate

groupIDs
Array of integers

Comma-separated string of group IDs (e.g. "1,2"). Defaults to all of user's groups if filterIDs is not provided.

filterIDs
Array of integers

Comma-separated string of filter IDs (e.g. "1,2"). Defaults to all of user's groups' filters if groupIDs is not provided.

Responses

200
400
get/api/candidates
/api/candidates

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

POST a new candidate.

POST a new candidate.

Request Body schema: application/json
ra
number <float> Nullable
dec
number <float> Nullable
id
required
string

Name of the object.

ra_dis
number <float> Nullable

J2000 Right Ascension at discovery time [deg].

dec_dis
number <float> Nullable

J2000 Declination at discovery time [deg].

ra_err
number <float> Nullable

Error on J2000 Right Ascension at discovery time [deg].

dec_err
number <float> Nullable

Error on J2000 Declination at discovery time [deg].

offset
number <float> Nullable

Offset from nearest static object [arcsec].

redshift
number <float> Nullable

Redshift.

altdata
any Nullable

Misc. alternative metadata stored in JSON format, e.g. {'gaia': {'info': {'Teff': 5780}}}

dist_nearest_source
number <float> Nullable

Distance to the nearest Obj [arcsec].

mag_nearest_source
number <float> Nullable

Magnitude of the nearest Obj [AB].

e_mag_nearest_source
number <float> Nullable

Error on magnitude of the nearest Obj [mag].

transient
boolean Nullable

Boolean indicating whether the object is an astrophysical transient.

varstar
boolean Nullable

Boolean indicating whether the object is a variable star.

is_roid
boolean Nullable

Boolean indicating whether the object is a moving object.

score
number <float> Nullable

Machine learning score.

origin
string Nullable

Origin of the object.

internal_key
string

Internal key used for secure websocket messaging.

detect_photometry_count
integer <int32> Nullable

How many times the object was detected above :math:S/N = 5.

filter_ids
required
Array of integers

List of associated filter IDs

passing_alert_id
integer Nullable

ID of associated filter that created candidate

passed_at
string Nullable

Arrow-parseable datetime string indicating when passed filter.

Responses

200
post/api/candidates
/api/candidates

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ra": 0,
  • "dec": 0,
  • "id": "string",
  • "ra_dis": 0,
  • "dec_dis": 0,
  • "ra_err": 0,
  • "dec_err": 0,
  • "offset": 0,
  • "redshift": 0,
  • "altdata": null,
  • "dist_nearest_source": 0,
  • "mag_nearest_source": 0,
  • "e_mag_nearest_source": 0,
  • "transient": true,
  • "varstar": true,
  • "is_roid": true,
  • "score": 0,
  • "origin": "string",
  • "internal_key": "string",
  • "detect_photometry_count": 0,
  • "filter_ids":
    [
    ],
  • "passing_alert_id": 0,
  • "passed_at": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a classification

Retrieve a classification

path Parameters
classification_id
required
integer

Responses

200
400
get/api/classification/classification_id
/api/classification/classification_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update a classification

Update a classification

path Parameters
classification
required
integer
Request Body schema: application/json
classification
required
string

The assigned class.

taxonomy_id
required
integer <int32>

ID of the Taxonomy in which this Classification was made.

probability
number <float> Nullable

User-assigned probability of belonging to this class

author_id
required
integer <int32>

ID of the User that made this Classification

author_name
required
string

User.username or Token.id of the Classification's author.

obj_id
required
string

ID of the Classification's Obj.

group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view classification.

Responses

200
400
put/api/classification/classification_id
/api/classification/classification_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "classification": "string",
  • "taxonomy_id": 0,
  • "probability": 0,
  • "author_id": 0,
  • "author_name": "string",
  • "obj_id": "string",
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete a classification

Delete a classification

path Parameters
classification_id
required
integer

Responses

200
delete/api/classification/classification_id
/api/classification/classification_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Post a classification

Post a classification

Request Body schema: application/json
obj_id
required
string
classification
required
string
taxonomy_id
required
integer
probability
float [ 0 .. 1 ] Nullable

User-assigned probability of this classification on this taxonomy. If multiple classifications are given for the same source by the same user, the sum of the classifications ought to equal unity. Only individual probabilities are checked.

group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view classification. Defaults to all of requesting user's groups.

Responses

200
post/api/classification
/api/classification

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "obj_id": "string",
  • "classification": "string",
  • "taxonomy_id": 0,
  • "probability": null,
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a comment

Retrieve a comment

path Parameters
comment_id
required
integer

Responses

200
400
get/api/comment/comment_id
/api/comment/comment_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update a comment

Update a comment

path Parameters
comment_id
required
integer
Request Body schema: application/json
text
required
string

Comment body.

ctype
string <= 8 characters Nullable
Enum: "text" "redshift"

Comment type. Can be one of 'text' or 'redshift'.

attachment_name
string Nullable

Filename of the attachment.

attachment_type
string Nullable

Attachment extension, (e.g., pdf, png).

attachment_bytes
string Nullable

Binary representation of the attachment.

origin
string Nullable

Comment origin.

author_id
required
integer <int32>

ID of the Comment author's User instance.

obj_id
required
string

ID of the Comment's Obj.

group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view comment.

Responses

200
400
put/api/comment/comment_id
/api/comment/comment_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "text": "string",
  • "ctype": "text",
  • "attachment_name": "string",
  • "attachment_type": "string",
  • "attachment_bytes": "string",
  • "origin": "string",
  • "author_id": 0,
  • "obj_id": "string",
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete a comment

Delete a comment

path Parameters
comment_id
required
integer

Responses

200
delete/api/comment/comment_id
/api/comment/comment_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Post a comment

Post a comment

Request Body schema: application/json
obj_id
required
string
text
required
string
group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view comment. Defaults to all of requesting user's groups.

attachment
object

Responses

200
post/api/comment
/api/comment

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "obj_id": "string",
  • "text": "string",
  • "group_ids":
    [
    ],
  • "attachment":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Download comment attachment

Download comment attachment

path Parameters
comment_id
required
integer

Responses

200
get/api/comment/comment_id/attachment
/api/comment/comment_id/attachment

Post a message from a remote facility

Post a message from a remote facility

Request Body schema: application/json
One of
  • SEDMListener
new_status
required
string
followup_request_id
required
integer

Responses

200
400
post/api/facility
/api/facility

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "new_status": "string",
  • "followup_request_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve a filter

Retrieve a filter

path Parameters
filter_id
required
integer

Responses

200
400
get/api/filters/filter_id
/api/filters/filter_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Delete a filter

Delete a filter

path Parameters
filter_id
required
integer

Responses

200
delete/api/filters/filter_id
/api/filters/filter_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Update filter name

Update filter name

path Parameters
filter_id
required
integer
Request Body schema: application/json
name
required
string

Filter name.

stream_id
required
integer <int32>

ID of the Filter's Stream.

group_id
required
integer <int32>

ID of the Filter's Group.

Responses

200
400
patch/api/filters/filter_id
/api/filters/filter_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "stream_id": 0,
  • "group_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all filters

Retrieve all filters

Responses

200
400
get/api/filters
/api/filters

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    [
    ],
  • "message": "string"
}

POST a new filter.

POST a new filter.

Request Body schema: application/json
name
required
string

Filter name.

stream_id
required
integer <int32>

ID of the Filter's Stream.

group_id
required
integer <int32>

ID of the Filter's Group.

Responses

200
post/api/filters
/api/filters

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "stream_id": 0,
  • "group_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a followup request

Retrieve a followup request

path Parameters
followup_request_id
required
integer

Responses

200
400
get/api/followup_request/followup_request_id
/api/followup_request/followup_request_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Retrieve all followup requests

Retrieve all followup requests

Responses

200
400
get/api/followup_request
/api/followup_request

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    [
    ],
  • "message": "string"
}

Submit follow-up request.

Submit follow-up request.

Request Body schema: application/json
requester_id
required
integer <int32>

ID of the User who requested the follow-up.

obj_id
required
string

ID of the target Obj.

payload
any Nullable

Content of the followup request.

status
string

The status of the request.

allocation_id
required
integer <int32>

Responses

200
post/api/followup_request
/api/followup_request

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "requester_id": 0,
  • "obj_id": "string",
  • "payload": null,
  • "status": "string",
  • "allocation_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Update a follow-up request

Update a follow-up request

path Parameters
request_id
required
string
Request Body schema: application/json
requester_id
required
integer <int32>

ID of the User who requested the follow-up.

obj_id
required
string

ID of the target Obj.

payload
any Nullable

Content of the followup request.

status
string

The status of the request.

allocation_id
required
integer <int32>

Responses

200
400
put/api/followup_request/request_id
/api/followup_request/request_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "requester_id": 0,
  • "obj_id": "string",
  • "payload": null,
  • "status": "string",
  • "allocation_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete follow-up request.

Delete follow-up request.

path Parameters
request_id
required
string

Responses

200
delete/api/followup_request/request_id
/api/followup_request/request_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve the ID of the public group

Retrieve the ID of the public group

Responses

200
get/api/groups/public
/api/groups/public

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "id": 0
}

Add alert stream access to group

Add alert stream access to group

path Parameters
group_id
required
integer
Request Body schema: application/json
stream_id
required
integer

Responses

200
post/api/groups/group_id/streams/ignored_args
/api/groups/group_id/streams/ignored_args

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "stream_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Delete an alert stream from group

Delete an alert stream from group

path Parameters
group_id
required
integer
stream_id
required
integer

Responses

200
delete/api/groups/group_id/streams/stream_id
/api/groups/group_id/streams/stream_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Add a group user

Add a group user

path Parameters
group_id
required
integer
Request Body schema: application/json
username
required
string
admin
required
boolean

Responses

200
post/api/groups/group_id/users/ignored_args
/api/groups/group_id/users/ignored_args

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "username": "string",
  • "admin": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Delete a group user

Delete a group user

path Parameters
group_id
required
integer
username
required
string

Responses

200
delete/api/groups/group_id/users/username
/api/groups/group_id/users/username

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve a group

Retrieve a group

path Parameters
group_id
required
integer

Responses

200
400
get/api/groups/group_id
/api/groups/group_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Update a group

Update a group

path Parameters
group_id
required
integer
Request Body schema: application/json
name
required
string

Name of the group.

Responses

200
400
put/api/groups/group_id
/api/groups/group_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete a group

Delete a group

path Parameters
group_id
required
integer

Responses

200
delete/api/groups/group_id
/api/groups/group_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all groups

Retrieve all groups

query Parameters
name
string

Fetch by name (exact match)

includeSingleUserGroups
boolean

Bool indicating whether to include single user groups. Defaults to false.

Responses

200
400
get/api/groups
/api/groups

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Create a new group

Create a new group

Request Body schema: application/json
name
required
string

Name of the group.

group_admins
Array of integers

List of IDs of users to be group admins. Current user will automatically be added as a group admin.

Responses

200
post/api/groups
/api/groups

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "group_admins":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve an instrument

Retrieve an instrument

path Parameters
instrument_id
required
integer

Responses

200
400
get/api/instrument/instrument_id
/api/instrument/instrument_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update instrument

Update instrument

path Parameters
instrument_id
required
integer
Request Body schema: application/json
name
required
string

Instrument name.

type
required
string <= 20 characters
Enum: "imager" "spectrograph" "imaging spectrograph"

Instrument type, one of Imager, Spectrograph, or Imaging Spectrograph.

band
string Nullable

The spectral band covered by the instrument (e.g., Optical, IR).

telescope_id
required
integer <int32>

The ID of the Telescope that hosts the Instrument.

filters
Array of any

List of filters on the instrument (if any).

api_classname
string <= 7 characters Nullable
Value: "SEDMAPI"

Name of the instrument's API class.

listener_classname
string <= 12 characters Nullable
Value: "SEDMListener"

Name of the instrument's listener class.

Responses

200
400
put/api/instrument/instrument_id
/api/instrument/instrument_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "type": "imager",
  • "band": "string",
  • "telescope_id": 0,
  • "filters":
    [
    ],
  • "api_classname": "SEDMAPI",
  • "listener_classname": "SEDMListener"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete an instrument

Delete an instrument

path Parameters
instrument_id
required
integer

Responses

200
400
delete/api/instrument/instrument_id
/api/instrument/instrument_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all instruments

Retrieve all instruments

query Parameters
name
string

Filter by name (exact match)

Responses

200
400
get/api/instrument
/api/instrument

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    [
    ],
  • "message": "string"
}

Add a new instrument

Add a new instrument

Request Body schema: application/json
name
required
string

Instrument name.

type
required
string <= 20 characters
Enum: "imager" "spectrograph" "imaging spectrograph"

Instrument type, one of Imager, Spectrograph, or Imaging Spectrograph.

band
string Nullable

The spectral band covered by the instrument (e.g., Optical, IR).

telescope_id
required
integer <int32>

The ID of the Telescope that hosts the Instrument.

filters
Array of strings
Default: []
Items Enum: "bessellux" "bessellb" "bessellv" "bessellr" "besselli" "standard::u" "standard::b" "standard::v" "standard::r" "standard::i" "desg" "desr" "desi" "desz" "desy" "sdssu" "sdssg" "sdssr" "sdssi" "sdssz" "f435w" "f475w" "f555w" "f606w" "f625w" "f775w" "f850lp" "nicf110w" "nicf160w" "f098m" "f105w" "f110w" "f125w" "f127m" "f139m" "f140w" "f153m" "f160w" "f218w" "f225w" "f275w" "f300x" "f336w" "f350lp" "f390w" "f689m" "f763m" "f845m" "f438w" "uvf475w" "uvf555w" "uvf606w" "uvf625w" "uvf775w" "uvf814w" "uvf850lp" "kepler" "cspb" "csphs" "csphd" "cspjs" "cspjd" "cspv3009" "cspv3014" "cspv9844" "cspys" "cspyd" "cspg" "cspi" "cspk" "cspr" "cspu" "f070w" "f090w" "f115w" "f150w" "f200w" "f277w" "f356w" "f444w" "f140m" "f162m" "f182m" "f210m" "f250m" "f300m" "f335m" "f360m" "f410m" "f430m" "f460m" "f480m" "f560w" "f770w" "f1000w" "f1130w" "f1280w" "f1500w" "f1800w" "f2100w" "f2550w" "f1065c" "f1140c" "f1550c" "f2300c" "lsstu" "lsstg" "lsstr" "lssti" "lsstz" "lssty" "keplercam::us" "keplercam::b" "keplercam::v" "keplercam::r" "keplercam::i" "4shooter2::us" "4shooter2::b" "4shooter2::v" "4shooter2::r" "4shooter2::i" "ztfg" "ztfr" "ztfi"

List of filters on the instrument (if any).

api_classname
string <= 7 characters Nullable
Value: "SEDMAPI"

Name of the instrument's API class.

listener_classname
string <= 12 characters Nullable
Value: "SEDMListener"

Name of the instrument's listener class.

Responses

200
400
post/api/instrument
/api/instrument

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "type": "imager",
  • "band": "string",
  • "telescope_id": 0,
  • "filters":
    [
    ],
  • "api_classname": "SEDMAPI",
  • "listener_classname": "SEDMListener"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Invite a new user

Invite a new user

Request Body schema: application/json
userEmail
required
string
streamIDs
Array of integers

List of IDs of streams invited user will be given access to. If not provided, user will be granted access to all streams associated with the groups specified by groupIDs.

groupIDs
required
Array of integers

List of IDs of groups invited user will be added to. If streamIDs is not provided, invited user will be given accesss to all streams associated with the groups specified by this field.

groupAdmin
Array of booleans

List of booleans indicating whether user should be granted admin status for respective specified group(s).

Responses

200
post/api/invitations
/api/invitations

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "userEmail": "string",
  • "streamIDs":
    [
    ],
  • "groupIDs":
    [
    ],
  • "groupAdmin":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve summary of recent activity

Retrieve summary of recent activity

Responses

200
400
get/api/newsfeed
/api/newsfeed

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Retrieve an observing run

Retrieve an observing run

path Parameters
run_id
required
integer

Responses

200
400
get/api/observing_run/run_id
/api/observing_run/run_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update observing run

Update observing run

path Parameters
run_id
required
integer
Request Body schema: application/json
modified
string <date-time>

The UT datetime at which the observingrun was last modified.

observers
string

The names of the observers

calendar_date
required
string <date>

The local calendar date of the run.

group_id
integer <int32>

The ID of the group this run is associated with.

pi
string

The PI of the observing run.

instrument_id
required
integer <int32>

The ID of the instrument to be used in this run.

Responses

200
400
put/api/observing_run/run_id
/api/observing_run/run_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "modified": "2020-09-22T02:09:25Z",
  • "observers": "string",
  • "calendar_date": "2020-09-22",
  • "group_id": 0,
  • "pi": "string",
  • "instrument_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete an observing run

Delete an observing run

path Parameters
run_id
required
integer

Responses

200
400
delete/api/observing_run/run_id
/api/observing_run/run_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all observing runs

Retrieve all observing runs

Responses

200
400
get/api/observing_run
/api/observing_run

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    [
    ],
  • "message": "string"
}

Add a new observing run

Add a new observing run

Request Body schema: application/json
modified
string <date-time>

The UT datetime at which the observingrun was last modified.

observers
string

The names of the observers

calendar_date
required
string <date>

The local calendar date of the run.

group_id
integer <int32>

The ID of the group this run is associated with.

pi
string

The PI of the observing run.

instrument_id
required
integer <int32>

The ID of the instrument to be used in this run.

Responses

200
400
post/api/observing_run
/api/observing_run

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "modified": "2020-09-22T02:09:25Z",
  • "observers": "string",
  • "calendar_date": "2020-09-22",
  • "group_id": 0,
  • "pi": "string",
  • "instrument_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve photometry

Retrieve photometry

path Parameters
photometry_id
required
integer
query Parameters
format
string
Enum: "mag" "flux"

Return the photometry in flux or magnitude space? If a value for this query parameter is not provided, the result will be returned in magnitude space.

magsys
string
Enum: "jla1" "ab" "vega" "bd17" "csp" "ab-b12"

The magnitude or zeropoint system of the output. (Default AB)

Responses

200
400
get/api/photometry/photometry_id
/api/photometry/photometry_id

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update photometry

Update photometry

path Parameters
photometry_id
required
integer
Request Body schema: application/json
One of
  • PhotometryMag
  • PhotometryFlux
assignment_id
integer <int32> Nullable
Default: null

ID of the classical assignment which generated the photometry

dec_unc
number Nullable
Default: null

Uncertainty on dec [arcsec].

mag
number Nullable
Default: null

Magnitude of the observation in the magnitude system magsys. Can be null in the case of a non-detection.

ra
number Nullable
Default: null

ICRS Right Ascension of the centroid of the photometric aperture [deg].

dec
number Nullable
Default: null

ICRS Declination of the centroid of the photometric aperture [deg].

limiting_mag
required
number

Limiting magnitude of the image in the magnitude system magsys.

filter
required
any
Enum: "bessellux" "bessellb" "bessellv" "bessellr" "besselli" "standard::u" "standard::b" "standard::v" "standard::r" "standard::i" "desg" "desr" "desi" "desz" "desy" "sdssu" "sdssg" "sdssr" "sdssi" "sdssz" "f435w" "f475w" "f555w" "f606w" "f625w" "f775w" "f850lp" "nicf110w" "nicf160w" "f098m" "f105w" "f110w" "f125w" "f127m" "f139m" "f140w" "f153m" "f160w" "f218w" "f225w" "f275w" "f300x" "f336w" "f350lp" "f390w" "f689m" "f763m" "f845m" "f438w" "uvf475w" "uvf555w" "uvf606w" "uvf625w" "uvf775w" "uvf814w" "uvf850lp" "kepler" "cspb" "csphs" "csphd" "cspjs" "cspjd" "cspv3009" "cspv3014" "cspv9844" "cspys" "cspyd" "cspg" "cspi" "cspk" "cspr" "cspu" "f070w" "f090w" "f115w" "f150w" "f200w" "f277w" "f356w" "f444w" "f140m" "f162m" "f182m" "f210m" "f250m" "f300m" "f335m" "f360m" "f410m" "f430m" "f460m" "f480m" "f560w" "f770w" "f1000w" "f1130w" "f1280w" "f1500w" "f1800w" "f2100w" "f2550w" "f1065c" "f1140c" "f1550c" "f2300c" "lsstu" "lsstg" "lsstr" "lssti" "lsstz" "lssty" "keplercam::us" "keplercam::b" "keplercam::v" "keplercam::r" "keplercam::i" "4shooter2::us" "4shooter2::b" "4shooter2::v" "4shooter2::r" "4shooter2::i" "ztfg" "ztfr" "ztfi"

The bandpass of the observation.

ra_unc
number Nullable
Default: null

Uncertainty on RA [arcsec].

magsys
required
any
Enum: "jla1" "ab" "vega" "bd17" "csp" "ab-b12"

The magnitude system to which the flux and the zeropoint are tied.

magerr
number Nullable
Default: null

Magnitude error of the observation in the magnitude system magsys. Can be null in the case of a non-detection.

obj_id
required
string

ID of the Object to which the photometry will be attached.

instrument_id
required
integer <int32>

ID of the instrument with which the observation was carried out.

mjd
required
number

MJD of the observation.

altdata
object Nullable
Default: null

Misc. alternative metadata stored in JSON format, e.g. {'calibration': {'source': 'ps1', 'color_term': 0.012}, 'photometry_method': 'allstar', 'method_reference': 'Masci et al. (2015)'}

alert_id
integer <int32> Nullable
Default: null

Corresponding alert ID. If a record is already present with identical alert ID, only the groups list will be updated (other alert data assumed identical). Defaults to None.

Responses

200
400
put/api/photometry/photometry_id
/api/photometry/photometry_id

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "assignment_id": null,
  • "dec_unc": null,
  • "mag": null,
  • "ra": null,
  • "dec": null,
  • "limiting_mag": 0,
  • "filter": "bessellux",
  • "ra_unc": null,
  • "magsys": "jla1",
  • "magerr": null,
  • "obj_id": "string",
  • "instrument_id": 0,
  • "mjd": 0,
  • "altdata": null,
  • "alert_id": null
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete photometry

Delete photometry

path Parameters
photometry_id
required
integer

Responses

200
400
delete/api/photometry/photometry_id
/api/photometry/photometry_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Upload photometry

Upload photometry

Request Body schema: application/json
One of
  • PhotMagFlexible
  • PhotFluxFlexible
assignment_id
integer <int32> Nullable
Default: null

ID of the classical assignment which generated the photometry

dec_unc
any Nullable
Default: null

Uncertainty on dec [arcsec]. Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values allowed.

mag
any Nullable
Default: null

Magnitude of the observation in the magnitude system magsys. Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values allowed for non-detections. If mag is null, the corresponding magerr must also be null.

ra
any Nullable
Default: null

ICRS Right Ascension of the centroid of the photometric aperture [deg]. Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values allowed.

dec
any Nullable
Default: null

ICRS Declination of the centroid of the photometric aperture [deg]. Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values allowed.

limiting_mag_nsigma
any
Default: 5

Number of standard deviations above the background that the limiting magnitudes correspond to. Null values not allowed. Default = 5.

limiting_mag
required
any

Limiting magnitude of the image in the magnitude system magsys. Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values not allowed.

filter
required
any

The bandpass of the observation(s). Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values not allowed. Allowed values: bessellux, bessellb, bessellv, bessellr, besselli, standard::u, standard::b, standard::v, standard::r, standard::i, desg, desr, desi, desz, desy, sdssu, sdssg, sdssr, sdssi, sdssz, f435w, f475w, f555w, f606w, f625w, f775w, f850lp, nicf110w, nicf160w, f098m, f105w, f110w, f125w, f127m, f139m, f140w, f153m, f160w, f218w, f225w, f275w, f300x, f336w, f350lp, f390w, f689m, f763m, f845m, f438w, uvf475w, uvf555w, uvf606w, uvf625w, uvf775w, uvf814w, uvf850lp, kepler, cspb, csphs, csphd, cspjs, cspjd, cspv3009, cspv3014, cspv9844, cspys, cspyd, cspg, cspi, cspk, cspr, cspu, f070w, f090w, f115w, f150w, f200w, f277w, f356w, f444w, f140m, f162m, f182m, f210m, f250m, f300m, f335m, f360m, f410m, f430m, f460m, f480m, f560w, f770w, f1000w, f1130w, f1280w, f1500w, f1800w, f2100w, f2550w, f1065c, f1140c, f1550c, f2300c, lsstu, lsstg, lsstr, lssti, lsstz, lssty, keplercam::us, keplercam::b, keplercam::v, keplercam::r, keplercam::i, 4shooter2::us, 4shooter2::b, 4shooter2::v, 4shooter2::r, 4shooter2::i, ztfg, ztfr, ztfi

ra_unc
any Nullable
Default: null

Uncertainty on RA [arcsec]. Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values allowed.

magsys
required
any

The magnitude system to which the magnitude, magnitude error, and limiting magnitude are tied. Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values not allowed. Allowed values: jla1, ab, vega, bd17, csp, ab-b12

magerr
any Nullable
Default: null

Magnitude of the observation in the magnitude system magsys. Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values allowed for non-detections. If magerr is null, the corresponding mag must also be null.

obj_id
required
any

ID of the Obj(s) to which the photometry will be attached. Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values are not allowed.

instrument_id
required
any

ID of the Instrument(s) with which the photometry was acquired. Can be given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values are not allowed.

group_ids
required
Array of integers <int32>

List of group IDs to which photometry points will be visible.

mjd
required
any

MJD of the observation(s). Can be a given as a scalar or a 1D list. If a scalar, will be broadcast to all values given as lists. Null values not allowed.

altdata
any Nullable
Default: null

Misc. alternative metadata stored in JSON format, e.g. {'calibration': {'source': 'ps1', 'color_term': 0.012}, 'photometry_method': 'allstar', 'method_reference': 'Masci et al. (2015)'}

alert_id
any

Corresponding alert ID. If a record is already present with identical alert ID, only the groups list will be updated (other alert data assumed identical). Defaults to None.

Responses

200
post/api/photometry
/api/photometry

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "assignment_id": null,
  • "dec_unc": null,
  • "mag": null,
  • "ra": null,
  • "dec": null,
  • "limiting_mag_nsigma": 5,
  • "limiting_mag": null,
  • "filter": null,
  • "ra_unc": null,
  • "magsys": null,
  • "magerr": null,
  • "obj_id": null,
  • "instrument_id": null,
  • "group_ids":
    [
    ],
  • "mjd": null,
  • "altdata": null,
  • "alert_id": null
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Share data with additional groups/users

Share data with additional groups/users

Request Body schema: application/json
photometryIDs
Array of integers

IDs of the photometry data to be shared. If spectrumIDs is not provided, this is required.

spectrumIDs
Array of integers

IDs of the spectra to be shared. If photometryIDs is not provided, this is required.

groupIDs
required
Array of integers

List of IDs of groups data will be shared with. To share data with a single user, specify their single user group ID here.

Responses

200
post/api/sharing
/api/sharing

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "photometryIDs":
    [
    ],
  • "spectrumIDs":
    [
    ],
  • "groupIDs":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete bulk-uploaded photometry set

Delete bulk-uploaded photometry set

path Parameters
upload_id
required
string

Responses

200
400
delete/api/photometry/bulk_delete/upload_id
/api/photometry/bulk_delete/upload_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all photometry associated with an Object

Retrieve all photometry associated with an Object

path Parameters
obj_id
required
string

ID of the object to retrieve photometry for

query Parameters
format
string
Enum: "mag" "flux"

Return the photometry in flux or magnitude space? If a value for this query parameter is not provided, the result will be returned in magnitude space.

magsys
string
Enum: "jla1" "ab" "vega" "bd17" "csp" "ab-b12"

The magnitude or zeropoint system of the output. (Default AB)

Responses

200
400
get/api/sources/obj_id/photometry
/api/sources/obj_id/photometry

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    [
    ],
  • "message": "string"
}

Retrieve all spectra associated with an Object

Retrieve all spectra associated with an Object

path Parameters
obj_id
required
string

ID of the object to retrieve spectra for

Responses

200
400
get/api/sources/obj_id/spectra
/api/sources/obj_id/spectra

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    [
    ],
  • "message": "string"
}

Retrieve offset stars to aid in spectroscopy

Retrieve offset stars to aid in spectroscopy

path Parameters
obj_id
required
string
query Parameters
facility
string
Enum: "Keck" "Shane" "P200"

Which facility to generate the starlist for

how_many
integer [ 0 .. 10 ]

Requested number of offset stars (set to zero to get starlist of just the source itself)

obstime
string

datetime of observation in isoformat (e.g. 2020-12-30T12:34:10)

Responses

200
400
get/api/sources/obj_id/offsets
/api/sources/obj_id/offsets

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Generate a PDF finding chart to aid in spectroscop

Generate a PDF finding chart to aid in spectroscopy

path Parameters
obj_id
required
string
query Parameters
imsize
float [ 2 .. 15 ]

Image size in arcmin (square)

facility
string
Enum: "Keck" "Shane" "P200"
image_source
string
Enum: "desi" "dss" "ztfref"

Source of the image used in the finding chart

obstime
string

datetime of observation in isoformat (e.g. 2020-12-30T12:34:10)

Responses

200

A PDF finding chart file

400
get/api/sources/obj_id/finder
/api/sources/obj_id/finder

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "error",
  • "data": { },
  • "message": "string"
}

Retrieve a source

Retrieve a source

path Parameters
obj_id
required
string

Responses

200
400
get/api/sources/obj_id
/api/sources/obj_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update a source

Update a source

path Parameters
obj_id
required
string
Request Body schema: application/json
ra
number <float> Nullable
dec
number <float> Nullable
ra_dis
number <float> Nullable

J2000 Right Ascension at discovery time [deg].

dec_dis
number <float> Nullable

J2000 Declination at discovery time [deg].

ra_err
number <float> Nullable

Error on J2000 Right Ascension at discovery time [deg].

dec_err
number <float> Nullable

Error on J2000 Declination at discovery time [deg].

offset
number <float> Nullable

Offset from nearest static object [arcsec].

redshift
number <float> Nullable

Redshift.

altdata
any Nullable

Misc. alternative metadata stored in JSON format, e.g. {'gaia': {'info': {'Teff': 5780}}}

dist_nearest_source
number <float> Nullable

Distance to the nearest Obj [arcsec].

mag_nearest_source
number <float> Nullable

Magnitude of the nearest Obj [AB].

e_mag_nearest_source
number <float> Nullable

Error on magnitude of the nearest Obj [mag].

transient
boolean Nullable

Boolean indicating whether the object is an astrophysical transient.

varstar
boolean Nullable

Boolean indicating whether the object is a variable star.

is_roid
boolean Nullable

Boolean indicating whether the object is a moving object.

score
number <float> Nullable

Machine learning score.

origin
string Nullable

Origin of the object.

internal_key
string

Internal key used for secure websocket messaging.

detect_photometry_count
integer <int32> Nullable

How many times the object was detected above :math:S/N = 5.

Responses

200
400
put/api/sources/obj_id
/api/sources/obj_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ra": 0,
  • "dec": 0,
  • "ra_dis": 0,
  • "dec_dis": 0,
  • "ra_err": 0,
  • "dec_err": 0,
  • "offset": 0,
  • "redshift": 0,
  • "altdata": null,
  • "dist_nearest_source": 0,
  • "mag_nearest_source": 0,
  • "e_mag_nearest_source": 0,
  • "transient": true,
  • "varstar": true,
  • "is_roid": true,
  • "score": 0,
  • "origin": "string",
  • "internal_key": "string",
  • "detect_photometry_count": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete a source

Delete a source

path Parameters
obj_id
required
string
group_id
required
string

Responses

200
delete/api/sources/obj_id
/api/sources/obj_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all sources

Retrieve all sources

query Parameters
ra
number

RA for spatial filtering

dec
number

Declination for spatial filtering

radius
number

Radius for spatial filtering if ra & dec are provided

sourceID
string

Portion of ID to filter on

simbadClass
string

Simbad class to filter on

hasTNSname
boolean

If true, return only those matches with TNS names

numPerPage
integer

Number of sources to return per paginated request. Defaults to 100. Max 1000.

pageNumber
integer

Page number for paginated query results. Defaults to 1

totalMatches
integer

Used only in the case of paginating query results - if provided, this allows for avoiding a potentially expensive query.count() call.

startDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, filter by last_detected >= startDate

endDate
string

Arrow-parseable date string (e.g. 2020-01-01). If provided, filter by last_detected <= endDate

group_ids
list

If provided, filter only sources saved to one of these group IDs.

Responses

200
400
get/api/sources
/api/sources

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Add a new source

Add a new source

Request Body schema: application/json
ra
number <float> Nullable
dec
number <float> Nullable
id
required
string

Name of the object.

ra_dis
number <float> Nullable

J2000 Right Ascension at discovery time [deg].

dec_dis
number <float> Nullable

J2000 Declination at discovery time [deg].

ra_err
number <float> Nullable

Error on J2000 Right Ascension at discovery time [deg].

dec_err
number <float> Nullable

Error on J2000 Declination at discovery time [deg].

offset
number <float> Nullable

Offset from nearest static object [arcsec].

redshift
number <float> Nullable

Redshift.

altdata
any Nullable

Misc. alternative metadata stored in JSON format, e.g. {'gaia': {'info': {'Teff': 5780}}}

dist_nearest_source
number <float> Nullable

Distance to the nearest Obj [arcsec].

mag_nearest_source
number <float> Nullable

Magnitude of the nearest Obj [AB].

e_mag_nearest_source
number <float> Nullable

Error on magnitude of the nearest Obj [mag].

transient
boolean Nullable

Boolean indicating whether the object is an astrophysical transient.

varstar
boolean Nullable

Boolean indicating whether the object is a variable star.

is_roid
boolean Nullable

Boolean indicating whether the object is a moving object.

score
number <float> Nullable

Machine learning score.

origin
string Nullable

Origin of the object.

internal_key
string

Internal key used for secure websocket messaging.

detect_photometry_count
integer <int32> Nullable

How many times the object was detected above :math:S/N = 5.

group_ids
Array of integers

List of associated group IDs. If not specified, all of the user or token's groups will be used.

Responses

200
post/api/sources
/api/sources

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "ra": 0,
  • "dec": 0,
  • "id": "string",
  • "ra_dis": 0,
  • "dec_dis": 0,
  • "ra_err": 0,
  • "dec_err": 0,
  • "offset": 0,
  • "redshift": 0,
  • "altdata": null,
  • "dist_nearest_source": 0,
  • "mag_nearest_source": 0,
  • "e_mag_nearest_source": 0,
  • "transient": true,
  • "varstar": true,
  • "is_roid": true,
  • "score": 0,
  • "origin": "string",
  • "internal_key": "string",
  • "detect_photometry_count": 0,
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a spectrum

Retrieve a spectrum

path Parameters
spectrum_id
required
integer

Responses

200
400
get/api/spectrum/spectrum_id
/api/spectrum/spectrum_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update spectrum

Update spectrum

path Parameters
spectrum_id
required
integer
Request Body schema: application/json
wavelengths
required
Array of numbers <float>

Wavelengths of the spectrum [Angstrom].

fluxes
required
Array of numbers <float>

Flux of the Spectrum [F_lambda, arbitrary units].

errors
Array of numbers <float> Nullable

Errors on the fluxes of the spectrum [F_lambda, same units as fluxes.]

obj_id
required
string

ID of this Spectrum's Obj.

observed_at
required
string <date-time>

Median UTC ISO time stamp of the exposure or exposures in which the Spectrum was acquired.

origin
string Nullable

Origin of the spectrum.

instrument_id
required
integer <int32>

ID of the Instrument that acquired the Spectrum.

followup_request_id
integer <int32> Nullable
assignment_id
integer <int32> Nullable

Responses

200
400
put/api/spectrum/spectrum_id
/api/spectrum/spectrum_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "wavelengths":
    [
    ],
  • "fluxes":
    [
    ],
  • "errors":
    [
    ],
  • "obj_id": "string",
  • "observed_at": "2020-09-22T02:09:26Z",
  • "origin": "string",
  • "instrument_id": 0,
  • "followup_request_id": 0,
  • "assignment_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete a spectrum

Delete a spectrum

path Parameters
spectrum_id
required
integer

Responses

200
400
delete/api/spectrum/spectrum_id
/api/spectrum/spectrum_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Upload spectrum

Upload spectrum

Request Body schema: application/json
wavelengths
required
Array of numbers <float>

Wavelengths of the spectrum [Angstrom].

fluxes
required
Array of numbers <float>

Flux of the Spectrum [F_lambda, arbitrary units].

errors
Array of numbers <float> Nullable

Errors on the fluxes of the spectrum [F_lambda, same units as fluxes.]

obj_id
required
string

ID of this Spectrum's Obj.

observed_at
required
string <date-time>

Median UTC ISO time stamp of the exposure or exposures in which the Spectrum was acquired.

origin
string Nullable

Origin of the spectrum.

instrument_id
required
integer <int32>

ID of the Instrument that acquired the Spectrum.

followup_request_id
integer <int32> Nullable
assignment_id
integer <int32> Nullable
group_ids
required
Array of integers

Group IDs that spectrum will be associated with

Responses

200
400
post/api/spectrum
/api/spectrum

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "wavelengths":
    [
    ],
  • "fluxes":
    [
    ],
  • "errors":
    [
    ],
  • "obj_id": "string",
  • "observed_at": "2020-09-22T02:09:26Z",
  • "origin": "string",
  • "instrument_id": 0,
  • "followup_request_id": 0,
  • "assignment_id": 0,
  • "group_ids":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Grant stream access to a user

Grant stream access to a user

path Parameters
stream_id
required
integer
Request Body schema: application/json
user_id
required
integer

Responses

200
post/api/streams/stream_id/users/ignored_args
/api/streams/stream_id/users/ignored_args

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Delete a stream user (revoke stream access for use

Delete a stream user (revoke stream access for user)

path Parameters
stream_id
required
integer
user_id
required
integer

Responses

200
delete/api/streams/stream_id/users/user_id
/api/streams/stream_id/users/user_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve a stream

Retrieve a stream

path Parameters
filter_id
required
integer

Responses

200
400
get/api/streams/stream_id
/api/streams/stream_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Delete a stream

Delete a stream

path Parameters
stream_id
required
integer

Responses

200
delete/api/streams/stream_id
/api/streams/stream_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Update a stream

Update a stream

path Parameters
stream_id
required
integer
Request Body schema: application/json
name
string
altdata
object

Responses

200
400
patch/api/streams/stream_id
/api/streams/stream_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "altdata": { }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all streams

Retrieve all streams

Responses

200
400
get/api/streams
/api/streams

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    [
    ],
  • "message": "string"
}

POST a new stream.

POST a new stream.

Request Body schema: application/json
name
required
string
altdata
object

Responses

200
post/api/streams
/api/streams

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "altdata": { }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve system/deployment info

Retrieve system/deployment info

Responses

200
get/api/sysinfo
/api/sysinfo

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data": { },
  • "properties": null
}

<no summary>

get/api/taxonomy/taxonomy_id
/api/taxonomy/taxonomy_id

Delete a taxonomy

Delete a taxonomy

path Parameters
taxonomy_id
required
integer

Responses

200
delete/api/taxonomy/taxonomy_id
/api/taxonomy/taxonomy_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Post new taxonomy

Post new taxonomy

Request Body schema: application/json
name
required
string

Short string to make this taxonomy memorable to end users.

hierarchy
required
object

Nested JSON describing the taxonomy which should be validated against a schema before entry

group_ids
Array of integers

List of group IDs corresponding to which groups should be able to view comment. Defaults to all of requesting user's groups.

version
required
string

Semantic version of this taxonomy name

provenance
string

Identifier (e.g., URL or git hash) that uniquely ties this taxonomy back to an origin or place of record

isLatest
boolean

Consider this version of the taxonomy with this name the latest? Defaults to True.

Responses

200
post/api/taxonomy
/api/taxonomy

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "hierarchy": { },
  • "group_ids":
    [
    ],
  • "version": "string",
  • "provenance": "string",
  • "isLatest": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a telescope

Retrieve a telescope

path Parameters
telescope_id
required
integer

Responses

200
400
get/api/telescope/telescope_id
/api/telescope/telescope_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update telescope

Update telescope

path Parameters
telescope_id
required
integer
Request Body schema: application/json
name
required
string

Unabbreviated facility name (e.g., Palomar 200-inch Hale Telescope).

nickname
required
string

Abbreviated facility name (e.g., P200).

lat
number <float> Nullable

Latitude in deg.

lon
number <float> Nullable

Longitude in deg.

elevation
number <float> Nullable

Elevation in meters.

diameter
required
number <float>

Diameter in meters.

skycam_link
string Nullable

Link to the telescope's sky camera.

robotic
boolean

Is this telescope robotic?

Responses

200
400
put/api/telescope/telescope_id
/api/telescope/telescope_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "nickname": "string",
  • "lat": 0,
  • "lon": 0,
  • "elevation": 0,
  • "diameter": 0,
  • "skycam_link": "string",
  • "robotic": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete a telescope

Delete a telescope

path Parameters
telescope_id
required
integer

Responses

200
400
delete/api/telescope/telescope_id
/api/telescope/telescope_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all telescopes

Retrieve all telescopes

query Parameters
name
string

Filter by name (exact match)

Responses

200
400
get/api/telescope
/api/telescope

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    [
    ],
  • "message": "string"
}

Create telescopes

Create telescopes

Request Body schema: application/json
name
required
string

Unabbreviated facility name (e.g., Palomar 200-inch Hale Telescope).

nickname
required
string

Abbreviated facility name (e.g., P200).

lat
number <float> Nullable

Latitude in deg.

lon
number <float> Nullable

Longitude in deg.

elevation
number <float> Nullable

Elevation in meters.

diameter
required
number <float>

Diameter in meters.

skycam_link
string Nullable

Link to the telescope's sky camera.

robotic
boolean

Is this telescope robotic?

Responses

200
400
post/api/telescope
/api/telescope

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "nickname": "string",
  • "lat": 0,
  • "lon": 0,
  • "elevation": 0,
  • "diameter": 0,
  • "skycam_link": "string",
  • "robotic": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a thumbnail

Retrieve a thumbnail

path Parameters
thumbnail_id
required
integer

Responses

200
400
get/api/thumbnail/thumbnail_id
/api/thumbnail/thumbnail_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Update thumbnail

Update thumbnail

path Parameters
thumbnail_id
required
integer
Request Body schema: application/json
type
string <= 6 characters Nullable
Enum: "new" "ref" "sub" "sdss" "dr8" "new_gz" "ref_gz" "sub_gz"

Thumbnail type (e.g., ref, new, sub, dr8, ...)

file_uri
string Nullable

Path of the Thumbnail on the machine running SkyPortal.

public_url
string Nullable

Publically accessible URL of the thumbnail.

origin
string Nullable

Origin of the Thumbnail.

photometry_id
required
integer <int32>

ID of the Thumbnail's corresponding Photometry point.

Responses

200
400
put/api/thumbnail/thumbnail_id
/api/thumbnail/thumbnail_id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "type": "new",
  • "file_uri": "string",
  • "public_url": "string",
  • "origin": "string",
  • "photometry_id": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Delete a thumbnail

Delete a thumbnail

path Parameters
thumbnail_id
required
integer

Responses

200
400
delete/api/thumbnail/thumbnail_id
/api/thumbnail/thumbnail_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Upload thumbnails

Upload thumbnails

Request Body schema: application/json
obj_id
string

ID of object associated with thumbnails. If specified, without photometry_id, the first photometry point associated with specified object will be associated with thumbnail(s).

photometry_id
integer

ID of photometry to be associated with thumbnails. If omitted, obj_id must be specified, in which case the first photometry entry associated with object will be used.

data
required
string <byte>

base64-encoded PNG image file contents. Image size must be between 16px and 500px on a side.

ttype
required
string

Thumbnail type. Must be one of 'new', 'ref', 'sub', 'sdss', 'dr8', 'new_gz', 'ref_gz', 'sub_gz'

Responses

200
400
post/api/thumbnail
/api/thumbnail

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "obj_id": "string",
  • "photometry_id": 0,
  • "data": "string",
  • "ttype": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}

Retrieve a user

Retrieve a user

path Parameters
user_id
required
integer

Responses

200
400
get/api/user/user_id
/api/user/user_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "data":
    {
    },
  • "message": "string"
}

Delete a user

Delete a user

path Parameters
user_id
required
integer

Responses

200
400
delete/api/user/user_id
/api/user/user_id

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string"
}

Retrieve all users

Retrieve all users

Responses

200
400
get/api/user
/api/user

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    [
    ]
}

Add a new user

Add a new user

Request Body schema: application/json
username
required
string

User's email address

first_name
string
last_name
string
contact_email
string
oauth_uid
string
contact_phone
string
roles
Array of strings

List of user roles. Defaults to [Full user]. Will be overridden by groupIDsAndAdmin on a per-group basis.

groupIDsAndAdmin
Array of arrays

Array of 2-element arrays [groupID, admin] where groupID is the ID of a group that the new user will be added to and admin is a boolean indicating whether they will be an admin in that group, e.g. [[group_id_1, true], [group_id_2, false]]

Responses

200
post/api/user
/api/user

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "username": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "contact_email": "string",
  • "oauth_uid": "string",
  • "contact_phone": "string",
  • "roles":
    [
    ],
  • "groupIDsAndAdmin":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "success",
  • "message": "string",
  • "data":
    {
    }
}